Welcome to Dream.In.Code
Getting Help is Easy!

Join 86,256 Programmers. There are 2,087 online right now! Ask your question and get quick answers from Dream.In.Code experts. Join the #1 programming help community on the internet! Registration is fast and FREE... Join Now!

Chat LIVE With a Expert
Powered by LivePerson.com

Register to Make This Box Go Away!

XCOPY Batch File Command--Help!

 
Reply to this topicStart new topic

XCOPY Batch File Command--Help!

polymath
post 11 Apr, 2008 - 10:53 AM
Post #1


D.I.C Head

Group Icon
Joined: 4 Apr, 2008
Posts: 78



Hi,
I was trying to create a batch file to copy certian files based on user imput. The user imput section works great, but my install section doesn't seem to work. I am using the xcopy command to copy files from a directory on a cd to my program files folder. Here is an excerpt from my code:
CODE
:INSTALL
ECHO.
ECHO Installing...
XCOPY \setup_files\test\ ("c:\program files\") /E /C /I /Q /H /R /T /K /O /Y
ECHO.
ECHO Finished with setup.
ECHO.
GOTO EXIT

The xcopy line returns an "invalid path" error from the command window, and i was wondering what went wrong with my program.

Polymath
User is online!Profile CardPM
Go to the top of the page
+Quote Post


no2pencil
post 11 Apr, 2008 - 06:13 PM
Post #2


DIC K-mart

Group Icon
Joined: 10 May, 2007
Posts: 3,321

What is the full path of \setup_files\test\?
User is online!Profile CardPM
Go to the top of the page
+Quote Post

polymath
post 12 Apr, 2008 - 09:31 AM
Post #3


D.I.C Head

Group Icon
Joined: 4 Apr, 2008
Posts: 78

I have heard that i do not need the full path because it is in the root directory of a drive letter, so it auto-detects the current drive its in. I am sure of this because i used the command "START \setup_files\test\test.txt" and it worked (obviously text.txt existed in this folder on the same drive as the .BAT file). The same should work for xcopy, i am assuming.
User is online!Profile CardPM
Go to the top of the page
+Quote Post

polymath
post 13 Apr, 2008 - 08:34 AM
Post #4


D.I.C Head

Group Icon
Joined: 4 Apr, 2008
Posts: 78

I was wondering, is there some differance between the XCOPY and the START commands that would cause such a differance? Is my syntax wrong for xcopy? do i need a modifier that specifies that i am copying directories?

SOMEBODY PLEASE REPLY!
User is online!Profile CardPM
Go to the top of the page
+Quote Post

polymath
post 14 Apr, 2008 - 03:42 PM
Post #5


D.I.C Head

Group Icon
Joined: 4 Apr, 2008
Posts: 78

For some reason when i removed some of the switches and changed to a differant second path, plus removed the () from the second path, it works fine. Normally with most dos commands it allows you to structure with ()s but it seems that for XCOPY that doesn't work.

EDIT: I went to computerhope.com and saw that XCOPY is an external command, does that cause it to behave differantly?
User is online!Profile CardPM
Go to the top of the page
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 5/16/08 09:35AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month