1
0
I have a batch file located in several folders and in this file I need to replace the old subst T: .
command for net use
because the units (drives) have different properties in windows 7.
However, I have only found that net use
only allows for absolute paths such as:
net use T: \\path\to\folder
I cannot work with absolute paths, but net use T: .
is not allowed (it throws an error).
Is there a way to execute the net use
command from a folder so that it uses the current .bat directory?
I think the best solution for me it would be to be able to get the absolute qualified path (\path\to\folder) with a batch command. (%cd% and chdir variables do not work in this case). Questions about getting the current directory or folder name are not useful since the net use
command does not allow paths such as x:\path\to\folder
What are you trying to accomplish? Create a 1:1 replacement for
subst
? Also, I don’t really understand whysubst
isn’t sufficient anymore. Could you perhaps elaborate? – Daniel B – 2016-01-18T18:17:57.827Of course. I did not go into details because it was not within the scope of the question. When running not-signed executables from a network-drive created with
subst
windows always prompts the message: "publisher could not be verified...", and I need the message not to be displayed. – Jorge – 2016-01-19T09:00:23.680@DanielB. Continuation: The thing is that I have lowered all local network security and tried it all to avoid this message but it keeps popping whenever I run it. However, if the network-drive is created from the
computer --> map network drive
button, even if the related folder path is the same it behaved differently fromsubst
. Windows does not show me the message any more this way. So what I need is a windows command to do what that button does. – Jorge – 2016-01-19T09:08:18.103