I have a drive-mapping script, mapping.cmd, that uses different accounts to map different drives.
Some of the account passwords have special characters in them like % which would be parsed incorrectly if entered straight into the mapping.cmd file.
So I've put the password containing the % character into a separate file, pwd.txt, and this imports in fine when called like this:
Code: Select all
net use p: \\[some path] /user:[some domain]\[some ID] < pwd.txt
Just wondering, if I wanted to map another drive in mapping.cmd, which again uses a special character, if I can in some way list multiple passwords in the same pwd.txt file, rather than the clunkier method of using yet another file, say pwd2.txt, just to hold this other password e.g.
Code: Select all
net use p: \\[some path] /user:[some domain]\[some ID] < pwd.txt
net use q: \\[some path] /user:[some domain]\[some ID] < pwd2.txt
Or should I just use the clunky method?