/build/static/layout/Breadcrumb_cap_w.png

echo command

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   [ + ] Show comments

Answers (2)

Posted by: anonymous_9363 13 years ago
Red Belt
0
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.
Posted by: bearden3 13 years ago
Purple Belt
0
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.

Example:
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ