I am running a batch script and outputting the info to a file in the temp folder, (just to learn from).
I have an input for a user to select which mapped drive they want their data transferred out of.
Here is what I have, it is super easy so I can learn then modify later.
Cls
@ECHO Off
Net use > c:\Temp\Map.txt
Net Use
Pause
:Start
ECHO Which Drive letter do you want to back up?
ECHO ? - Enter Drive letter
ECHO E - Exit
SET /P M=Make Choice then press ENTER:
IF %M%==E Exit Else goto :here
If %M%==e Exit Else goto :here
:Here
Echo %M%
Findstr "OK %M%:" c:\Temp\Map.txt
pause
What I need is to extract the path name for the drive they select. Like if there are 5 drives, and they want drive S:
backed up, output is:
OK S: \\10.X.X.X\Deployment\David\Davids_Scripts\bats
I would need the \\10.52.8.1\Deployment\David\Davids_Scripts\bats
saved so I can put it in a transfer script.