Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UNC paths are not supported...

6,394 views
Skip to first unread message

Marvin Kreyer

unread,
Jul 15, 2002, 3:19:59 AM7/15/02
to
It's easy, you launch a batch file like: Start
\\Server\Data\Reports\Audit.bat

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


Ritchie

unread,
Jul 15, 2002, 3:49:39 AM7/15/02
to
Marvin,
This may help:-

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...

Marvin Kreyer

unread,
Jul 15, 2002, 11:06:57 AM7/15/02
to
Thanks,

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...

Frank

unread,
Jul 15, 2002, 2:31:01 PM7/15/02
to
Marvin Kreyer <zIuY8.12099$Wt3.14817@rwcrnsc53>...


^ 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

unread,
Jul 15, 2002, 2:37:37 PM7/15/02
to
Unfortunately I'm unable to replicate the problem with W2K or NT4
(neither has the registry fix explained Q156276). Is there a particalur
command in the batch file that triggers the message?

--
Ritchie
Undo address for email.

"Marvin Kreyer" <MKr...@MyRealBox.com> wrote in message news:lyBY8.16244$Wt3.16147@rwcrnsc53...

Marvin Kreyer

unread,
Jul 16, 2002, 12:47:39 AM7/16/02
to
Batch file (Test.bat) contents:

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...

Marvin Kreyer

unread,
Jul 16, 2002, 12:52:35 AM7/16/02
to
Frank--I did exactly as you state below, and it works! However, it requires
the creation of a link file (shortcut). I really wanted to go up to a
machine on the network, open its "Run" command and properly launch a known
batch file on one of the servers.

Thanks for your help on this.

++Marvin

"Frank " <ovssl...@wzjrgifchqwcmevc.com> wrote in message
news:01c22c2d$7e917e90$0125250a@wzjrgifchqwcmevc...

Ritchie

unread,
Jul 16, 2002, 1:32:37 AM7/16/02
to
This works:-

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...

Marvin Kreyer

unread,
Jul 16, 2002, 2:26:21 AM7/16/02
to
This absolutely DOES work. Thank you for the tip

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...

Rick Campbell

unread,
Jul 16, 2002, 3:42:01 AM7/16/02
to
If you have any references within the batch file that are trying to access
files in the same location the batch file is being run from, then use the
following path: "%0\..\" as the prefix.

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...

0 new messages