I try to do a batch file to use subst
function.
Right now, I'm using paste
in the modify menu of cmd.exe
to add the string that I want to use.
I found that command :
powershell -sta "add-type -as System.Windows.Forms; [windows.forms.clipboard]::GetText()"
That shows my string ex.:
c:\user\ca\desktop\abb\cde
Now what I want to do is to use the subst
function to get a new letter for that directory, lets say z:
so I was doing
subst z: c:\user\ca\desktop\abb\cde
How can I use the result of powershell
to be in a variable that I can use with subst
?
Ex :
Subst z: %PowershellResult%
What I want to do exactly is a batch file which creates a virtual drive but that I'm able to copy the path in the explorer and it will create the virtual drive without need to type the path in cmd.exe
or click on the corner of the window, modify and paste.