Mapping to a network drive questions
Posted: 22 Jul 2009 12:18
Hello,
Here is the jist of what I am trying to do:
-Map drive to target machine
-transfer files to target machine
-run program on target machine
-store results on original machine
I need to make sure the drive letter I use to connect the target and original machine is available.
Is there a way to guarantee I always pick an available drive letter AND have the ability to retrieve that drive letter for use in transferring files back and forth? I am aware of the "net use * \\server\c$" command but not how to retrieve the drive letter chosen.
My other option is to have the user manually enter in a drive letter (net use %drive \\server\c$) but if they choose wrong the script just continues executing the rest of the commands and they obviously fail. Is there a way to confirm this command executed successfully? My idea is to keep having them enter a drive letter until they choose an available one. From here I can easily retrieve that information for use in transferring files.
Any other ideas would be greatly appreciated.
Here is the jist of what I am trying to do:
-Map drive to target machine
-transfer files to target machine
-run program on target machine
-store results on original machine
I need to make sure the drive letter I use to connect the target and original machine is available.
Is there a way to guarantee I always pick an available drive letter AND have the ability to retrieve that drive letter for use in transferring files back and forth? I am aware of the "net use * \\server\c$" command but not how to retrieve the drive letter chosen.
My other option is to have the user manually enter in a drive letter (net use %drive \\server\c$) but if they choose wrong the script just continues executing the rest of the commands and they obviously fail. Is there a way to confirm this command executed successfully? My idea is to keep having them enter a drive letter until they choose an available one. From here I can easily retrieve that information for use in transferring files.
Any other ideas would be greatly appreciated.