Microsoft
Software
Hardware
Network
Question : Need a batch file script/syntax to map a different share using the same/current drive letter. no DFS
no DFS
Were are moving the contents of network shares to another server, Im looking for a way to remap to the new share using the current drive letter. Different departments use different drive letters for the same share (application driven).
I need a batch file that the users from the different departments can run from the old network share to remap to the new share using whatever drive letter is currently used.
old share = \\filer\share
new share= \\file\share
This is what we want to accomplish:
1. Users come in to work and turn on their PC
2. They would open their network drive(whatever letter they are using) to access their network share and they would only see the mapping.bat file and a textfile instructing them to double click the batch file because their files and folders have been moved to another share location.
3. They would run the mapping.bat file
4. The batch file would map the new share using the current drive letter.
mapping.bat (located in the old share) contains the following:
@echo off
cls
net use [whatever drive letter is used]: /delete /y
net use [whatever drive letter is used]: \\file\food
exit
I guess to ask this question in another way is "How do you make the Drive letter a variable that corresponds to the current drive letter like how %systemroot% corresponds to the current install path & %username% corresponds to the current username used?"
net use [variable]: /delete /y
net use [variable]: \\file\food
Answer : Need a batch file script/syntax to map a different share using the same/current drive letter. no DFS
set CURRENT_DRIVE=%CD:~0,2%
Random Solutions
HTML to Jpeg online converter in website
Bash script help
New-Runspace cmdlet not recognized in Powershell V2 CTP3 with WinRM CTP3
How to access password-protected "My Documents" on corrupted Windows XP partition from other working partition
How to set mailbox quota for sendmail
Transfer my whole collection of 8mm (Video 8) Analogue Video tapes to PC - fastest way, size / quality trade-off - Any Advice ?
free subversion server ?
How do I calculate columns of data when checkbox checked on row.
Error using schtasks scheduling a task
IE launches and closes almost immediately