Computing.Net > Forums > Disk Operating System > Verify Drive Mapping

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Verify Drive Mapping

Reply to Message Icon

Name: Jet3
Date: April 16, 2003 at 06:15:12 Pacific
OS: Win98SE
CPU/Ram: varies
Comment:

Well, I hope someone here can help me. I'm setting up a logon script (a DOS batch file) for some Win98 machines on our domain and ran into a problem.
I am mapping some drives, but would like to have it check to see if there is already an existing drive using that letter (like if someone already mapped a network share manually).
What DOS command(s) can I use to have it check the drives? Something like "if exist J: goto DontMap".
Except I can't get "if exist" to test for the drive letter (just files inside the drive).
Any ideas?
Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: April 16, 2003 at 07:07:35 Pacific
Reply:

In your script use the following statement:

If not exist [Drive Letter]:\Nul GoTo MAP

where [Drive Letter] has to be substituted by a variable or static drive letter. Avoid check removable media (Floppy A and B), as a prompt will be issued (Retry, Fail, Continue).
I tested it under plain Dos and Win 9X and it worked, but if you experience any trouble, it can be improved.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Verify Drive Mapping

temporary drive mapping www.computing.net/answers/dos/temporary-drive-mapping/15234.html

What is the DOS command for mapping resources to a drive letter www.computing.net/answers/dos/what-is-the-dos-command-for-mapping-resources-to-a-drive-letter/1473.html

Way to persistently map drives from DOS www.computing.net/answers/dos/way-to-persistently-map-drives-from-dos-/6711.html