It runs fine, but not until you are reminded of your sick deed in this way:
CMD.EXE was started with '\\Server\Data\Reports' as the current directory
path.
UNC paths are not supported. Defaulting to Windows directory.
(Win2k or XP)
I understand that there is a registry edit that could be done to avoid this
check on the current directoy (not interested in doing that on 600+
computers and it shouldn't be necessary). But, how else is one expected to
launch a batch file that resides on another computer? Map a drive? I don't
think so.
And besides, I _did_ launch this thing from the "Windows" directory! (XP)
Hints, anyone?
++Marvin
Cmd.exe Does Not Support UNC Names as the Current Directory (Q156276)
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q156276
--
Ritchie
Undo address for email.
"Marvin Kreyer" <MKr...@MyRealBox.com> wrote in message news:zIuY8.12099$Wt3.14817@rwcrnsc53...
I have seen this (old) article. However, I am more interested in finding a
way to launch my batch file in such a way as to avoid the message--avoid
"law" that I am breaking here.
++Marvin
"Ritchie" <rlaw...@commanddoline.co.uk> wrote in message
news:3d327f33$0$8509$cc9e...@news.dial.pipex.com...
^ CMD.EXE was started with '\\Server\Data\Reports' as the current
^ directory path.
^ UNC paths are not supported. Defaulting to Windows directory.
Change the "Start-in" directory of the short cut to %SystemRoot% or %TEMP%
and add this as the first line of the batch file:
PUSHD \\Server\Data\Reports
Frank
--
Ritchie
Undo address for email.
"Marvin Kreyer" <MKr...@MyRealBox.com> wrote in message news:lyBY8.16244$Wt3.16147@rwcrnsc53...
Start here ======== do not include this line
@echo off
Pause
End here ======== do not include this line
I believe this is not a problem with the contents of the file, but instead
the way in which I am launching it.
The above batch file resides on a server (\\Server\Data). I am attempting to
launch the batch file from another machine on the network.
I go to the "Run" command (Start | Run) of any machine on the network (other
than the machine hosting the batch file) and enter \\Server\Data\Test.bat
(without the quotes) and click on "OK".
Result in a DOS window:
--------
CMD.EXE was started with '\\Server\Data' as the current directory path. UNC
paths
are not supported. Defaulting to Windows directory.
Press any key to continue . . .
--------
If I launch this (\\Server\Data\Test.bat) from the command line (in a DOS
window), I get no error--works like a champ.
This is more of a lesson in the rules around launching batch files than
anything (especially from the "Run" command).
Thanks!
++Marvin
"Ritchie" <rlaw...@commanddoline.co.uk> wrote in message
news:3d331719$0$236$cc9e...@news.dial.pipex.com...
Thanks for your help on this.
++Marvin
"Frank " <ovssl...@wzjrgifchqwcmevc.com> wrote in message
news:01c22c2d$7e917e90$0125250a@wzjrgifchqwcmevc...
Start | Run | cmd /c \\server\share\batch
--
Ritchie
Undo address for email.
"Marvin Kreyer" <MKr...@MyRealBox.com> wrote in message news:LzNY8.378996$R61.3...@rwcrnsc52.ops.asp.att.net...
I would like an explanation if you think I am able to absorb it. These are
the misinterpretations that I bring to the table:
1) the "cmd" launches a DOS window--I get a DOS window with out it why do I
need to ask it here?
2) quoting from the "cmd /?" request, "/C Carries out the command
specified by string and then terminates". Without it (cmd /c) it does indeed
'carry out the command and terminate', so why do I need it to suppress the
error/notification. What is it doing different with it (cmd /c) compared to
when I do not include it in the command line?
Where else is it "wise" to launch batch files in this way? Under what kinds
of conditions? Is it just "best practices"? Why do I *not* need to include
it when launching the remote batch file from command line in a DOS window?
In other words, why wasn't the reasoning for this obvious to me so that I
would select the appropriate syntax in the first place?
I really enjoy working with this stuff, and you guys have already taught me
a great deal. I read and study all the posts with the utmost of respect for
your efforts to teach, leaning bits and pieces as I am capable.
++Marvin
"Ritchie" <rlaw...@commanddoline.co.uk> wrote in message
news:3d33b09f$0$8507$cc9e...@news.dial.pipex.com...
Using this I am able to create and run batch files from a centralized script
repository from ANY server within the domain.
There is a MS KB document about it, but I don't remember what it's number
is.
"Marvin Kreyer" <MKr...@MyRealBox.com> wrote in message
news:nENY8.55268$uw.3...@rwcrnsc51.ops.asp.att.net...