Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Programming Languages (http://www.programmingforums.org/forum38.html)
-   -   Batch Question (http://www.programmingforums.org/showthread.php?t=10443)

NightShade01 Jun 20th, 2006 1:22 AM

Batch Question
 
i'm not sure if this is the right spot for this question but i wasn't sure where else to put it....

I'm trying to make a very simple batch file that will execute within a vb.net program i'm writing. I want to be able to click a button (in vb) and it will execute a batch file that simply copies one file in a folder location to another.
I'm getting all these errors though that the file's invalid, then it couldn't find it. I'm not sure what i'm doing wrong here....

Example:
defs.bin :: is the file example

copy C:\Program Files\defs.bin C:\Program Files\My Program\defs.bin

Booooze Jun 20th, 2006 1:54 AM

Quote:

Originally Posted by NightShade01
copy C:\Program Files\defs.bin C:\Program Files\My Program\defs.bin

The copy command takes 2 arguments.

:

copy [sourcefile] [destinationfile]

When you put a space in "program files" it, doesn't read properly. It's why you are having problems.

this is what you need: c:\Progra~1\file.bin

Check this out :
http://www.ericphelps.com/batch/lists/filelist.htm

NightShade01 Jun 20th, 2006 5:13 PM

Thanks for the info i read through the site but when i tried to make a slightly more complex batch file i kept getting errors....not sure what i'm still doing wrong. Actual files being used

COPY /-y C:\Program Files\EMC\Anti Virus Updates.bin C:\Program Files\Anti Virus

Which i re wrote as :

COPY /-y C:\Progra~1\EMC\Anti Virus Updates.bin C:\Progra~1\Anti Virus

Booooze Jun 20th, 2006 6:39 PM

Quote:

COPY /-y C:\Progra~1\EMC\Anti Virus Updates.bin C:\Progra~1\Anti Virus
You still have spaces in there. You should really avoid using spaces in filenames. It makes things a pain in the ass for batch files. I always just avoided it.


All times are GMT -5. The time now is 8:05 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC