
Quote: Originally Posted by
dreuzel
exactly my point
Now using Dos commands I often get problems they can not handle the UNC
this is long term project of MS to get that in order .......
spec's so we are in a locked up situation
require UNC to work all over .....
Sorry I was away on a job last night... back now to help.
I'm not understanding a key piece of the puzzle here.
1. What are you creating auto setup procedures for (is it software, installation, policy roll outs, etc)? I'm just trying to understand why the right click to admin-cmd is needed? If there is a different way to get the same results, understanding the project will help me help you.
2. Is this to go into a batch or vbs script?
3. The workaround is not good because UNC paths fail for another part of your project is this correct?

Quote: Originally Posted by
dreuzel
is there a way to add a mapped device ... (adding something before the
mapped command @="cmd.exe /s /k pushd \"%V\""
In batch-file world yes; but not so with our mapped drives (and I have no idea why)
you can normally link to CMD lines together with the && command; but I tried for a few minutes and failed with our mapped drives.
I also looked at finding the current path with %~dp0
Code:
set curpath=%~dp0
pushd %curpath%
but I couldn't get it to work from a single command line (i.e. && fails on this command because the variable needs to be found before it can be pushed). I will try again this evening when I have more time. I'll also look at 'calling' a batch file where we have more options and any other ideas that spring to mind (currently it's 11 am for me).

Quote: Originally Posted by
dreuzel
are there alternatives as %cd%
what is %v in this case is this explained somewhere
@="cmd.exe /s /k pushd \"%V\"
The V% is the variable, in your example it is the directory that CMD is called to.
Yep there's plenty of alternatives depending on what you want to do.
For example if I was to.....
Code:
net use X: \\media\PICTURES
X:
I don't need to cd to get to X, just 'X:' on it's own suffices. But I can't do this in one line 'net use X: \\media\PICTURES && X:' because the drive needs to be mapped first before it can be found.
You could use ~dp0 in place of %cd% for some instances.
for an example paste these into a bat or a command window
Code:
echo this is %%cd%% %cd%
echo this is %%~dp0 %~dp0
Lastly, for your scenario, is a shortcut that opens a CMD windows in a pre-specified mapped target an option?