Computing.Net > Forums > Windows NT > Redirect Net Share output to file

Redirect Net Share output to file

Reply to Message Icon

Original Message
Name: Robert Neri
Date: March 12, 2002 at 09:48:18 Pacific
Subject: Redirect Net Share output to file
Comment:

I'm wrting a script and in the script I would like to redirect the output of the Neet Share command to a file for further processing. How can I do this from with a script (batch file).

Thanks.


Report Offensive Message For Removal


Response Number 1
Name: fritz
Date: March 12, 2002 at 11:40:58 Pacific
Reply: (edit)

I am just learning scripting but my manual shows > yourfile.txt the > sends whatever is before it out to a file called yourfile.txt wich will overwrite the file if it allready exists
eg: Logon.bat > startup.txt I have tested this from the command prompt so it should work from your script. Hope this helps.


Report Offensive Follow Up For Removal

Response Number 2
Name: Robert Neri
Date: March 12, 2002 at 11:54:30 Pacific
Reply: (edit)

Thanks. I'm familiar with the use of ">". But in this instance it doesn't work. I was told that the "net" command pipes its output to the stderr stream on file descriptor 2. And I do not know how to redirect a stream from stderr file descriptor 2.


Report Offensive Follow Up For Removal

Response Number 3
Name: Anders Soee
Date: May 17, 2002 at 02:30:42 Pacific
Reply: (edit)

the synax for redirecting errout is "2>"
so the command would be:
net share > stdout.txt 2> errout.txt


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Redirect Net Share output to file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge