I'm on a Windows XP SP3 machine. If I open up a cmd window and type in this command it works.

ECHO this is a test > c:\temp\mytest.txt the string "this is a test" is written to the mytest.txt file.

But if I type in this command it fails

ECHO this is a test > \\MyServer\MyShare$\mytest.txt I gett this error: The network path was not found.

And I do have access to this server and share. From Explorer I can access this share and manaully create a .txt file there.
This server is remote (I'm in the USA and this server is in Asia). But why does echo not work?
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


DOS is very picky about what UNCs it deals with. Try running an EXE using a UNC path, for example.

I'd suggest converting whatever the batch file is doing to a proper scripting language.
Answered 02/08/2011 by: VBScab
Red Belt

Please log in to comment
Try using "net use" prior to your line and map a network drive to the UNC path. Then substitute the drive letter for the UNC path.

net use t: \\server\share
ECHO this is a test > t:\mytest.txt
net use t: /delete

That's just one way to do it. If this is just a simple thing that only you are going to use, it should work OK. Otherwise, I think that VBScript would be a better option for you as it will allow for better error trapping.
Answered 02/08/2011 by: bearden3
Purple Belt

Please log in to comment