so, here is my situation, any users i have that have a homedrive configured in AD and log in via WiFi only, lose the drive, so i want to make a batch script that gets the file path from AD, then maps it. so this command gets the path
dsquery domainroot -samid %username% | dsget user -hmdir
but it returns
hmdir
\servername\servershares\share
dsget succseded
so i need to parse out \servername\severshare\share and assign it to a variable, then pass it to the NET USE command. I am just getting super frustrated with string management in batch. any help on how to parse out the file path would be much appreciated. thanks.
Assuming there aren’t spaces in your
\servername\servershares\sharethen it’s can be solved with a FOR/F loop.