Log in

View Full Version : Batch file problem



neo_philiac
11-28-2006, 12:34 AM
OK here is another problem. I can map the x drive but the h drive depends on different users. in this line (if you see at the bottom)

net use h: \\home\String$ /persistent:Yes

the user knows the value of 'String' and it is different for each. Whoever runs the file will have to input the 'String' and the batch file will save it so it wont ask for the string anymore. Can this be done?

Batch File Code:
------------------------------------------------------------------
rem this file will remove all current drive mappings on the respective
rem drive letter then remap the connections

@echo off

cls
echo.
echo If you are using this from home
echo.
cls

c:
cd\windows\system32

rem delete all the drives potentially in use
net use h: /d
net use x: /d


rem remap the drives

net use h: \\home\String$ /persistent:Yes
net use x: \\aaaa\abcd$ /persistent:Yes

tech_support
11-29-2006, 06:53 AM
set /p store=Enter String:
echo.%store%

neo_philiac
11-30-2006, 02:46 PM
so would it be like this?

rem this file will remove all current drive mappings on the respective
rem drive letter then remap the connections

@echo off

cls
echo.
echo If you are using this from home
set /p store=Enter String:
echo.%store%
echo.
cls

c:
cd\windows\system32

rem delete all the drives potentially in use
net use h: /d


rem remap the drives

net use h: \\iuph\p$ /persistent:Yes (***where p is referencing the stored string***)

tech_support
12-01-2006, 04:57 AM
Not p$, %store%