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?
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)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Posted by:
bearden3
13 years ago
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.
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.
so that the conversation will remain readable.