4 Replies - 3533 Views - Last Post: 14 April 2008 - 03:42 PM Rate Topic: -----

#1 polymath  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 670
  • Joined: 04-April 08

XCOPY Batch File Command--Help!

Posted 11 April 2008 - 10:53 AM

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:
: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

Is This A Good Question/Topic? 0
  • +

Replies To: XCOPY Batch File Command--Help!

#2 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: XCOPY Batch File Command--Help!

Posted 11 April 2008 - 06:13 PM

What is the full path of \setup_files\test\?
Was This Post Helpful? 0
  • +
  • -

#3 polymath  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Re: XCOPY Batch File Command--Help!

Posted 12 April 2008 - 09:31 AM

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.
Was This Post Helpful? 0
  • +
  • -

#4 polymath  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Re: XCOPY Batch File Command--Help!

Posted 13 April 2008 - 08:34 AM

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!
Was This Post Helpful? 0
  • +
  • -

#5 polymath  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 52
  • View blog
  • Posts: 670
  • Joined: 04-April 08

Re: XCOPY Batch File Command--Help!

Posted 14 April 2008 - 03:42 PM

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?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1