Guest_imported
New member
- Jan 1, 1970
- 0
I'm writing a simple batch which will detect if a network drive exists before XCOPYing files over to it. If the drive doesn't exist then a GOTO statement should lead to a "NET USE" command. Part of the batch files looks like this:-
if exist L:\ goto COPYFILES
if not exist L:\ goto GETDRIVE
:GETDRIVE
net use L: \\LAPTOP\C
etc etc etc...
This all works fine in NT4 and W2K PRO, but for some strange reason fails to work in Windows ME!! The only way I can seemingly make it work in ME is to specify a dummy filename on the L:\ drive thus:-
if exist L:\fred.txt goto COPYFILES
if not exist L:\fred.txt goto GETDRIVE
Reading the helpfiles for the IF command, it doesn't in fact make any mention of specifying a condition for a DRIVE, only ERRORLEVEL, STRING MATCH or FILENAME.
So why does it NOT work in ME? Any clues as to what I'm doing wrong please?
ROGER - GØAOZ.
if exist L:\ goto COPYFILES
if not exist L:\ goto GETDRIVE
:GETDRIVE
net use L: \\LAPTOP\C
etc etc etc...
This all works fine in NT4 and W2K PRO, but for some strange reason fails to work in Windows ME!! The only way I can seemingly make it work in ME is to specify a dummy filename on the L:\ drive thus:-
if exist L:\fred.txt goto COPYFILES
if not exist L:\fred.txt goto GETDRIVE
Reading the helpfiles for the IF command, it doesn't in fact make any mention of specifying a condition for a DRIVE, only ERRORLEVEL, STRING MATCH or FILENAME.
So why does it NOT work in ME? Any clues as to what I'm doing wrong please?
ROGER - GØAOZ.