Monday, 11 October 2010

Map a drive in a Windows BAT file

The following can be used to map a drive in a windows bat file without causing an error when the drive already exists;

REM SETUP MAPPED DRIVE TO Y: IF IT Y: NOT EXIST
if not exist "y:" (net use y: \\myServerName\rootFolderOfMappedDrive)

No comments:

Post a Comment

Thanks for the feedback!