Discussion Locked

Batch file problem

0 helpful
16 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am writing a batch file that copies a file from a network share to a local machine's program files directory.
I get an error of two many parameters with this code

copy dlrstats.mdb C:\Progra~\Oasis32

I make net connection to the server share then I change to that drive and issue the above command.

The program that I am updating get's the update once a month and the prfogram cannot be run from the server. The programs creator sugested this procedure.

16 replies

by uellem

Make sure you add the "1" after "~", i.e.,

copy dlrstats.mdb C:\Progra~1\Oasis32.

You may also want to try spelling out the whole directory name but adding open and close quotes, i.e.,

copy dlrstats.mdb "C:\Program Files\Oasis32"

by shmaltz

Looks like the sharename is too long.
Make sure the sharename dosnt have any space in it, and its not too long. If the share is being used by other computers and you dont want to delete it, then just create a new share for that directory, you can do that in winnt, not sure about win9x.

by buffalodan

sharenames are truncated to 8.3 format when connecting from the command line...answer #1 is as close to reality as you'll get with this problem...add the 1

by buffalodan

P.S.:

The tilde (~) character is considered "THE LEAD IN CHARACTER in old fashioned command line programming, if this character is the final character before the directory dividor (the backslash) it is treated as a parameter, and windos expects acontrol character...

Batch programming in win 9x takes place in a 16 bit environment and must adhere to 8.3 filename rules...thusly, you can only have a file name with 8 characters, and a file extension with 3 characters. (8.3).

Hey, good luckwith this, and when you are done, drink numerous beers in honor of the bit bucket gods....

by pan 13 x

give this a try:

xcopy (drive letter of share)\folder location\filename c:\progra~1\oasis3~1

example: xcopy f:\share\dirstats.mbd c:\progra~1\oasis3~1

this should do the trick : the (~) is because long file name is not supported so you canonly see 6 letters of the filess.
go to the dirictory and walk through the file locations and you will see that it will have ~'s all through the structor.

This discussion is closed to new replies.