General discussion

Locked

How do I Send a batch command's output t

By garyg ·
I'm writing a batch script which executes several different command some of which are <b>net use * \\unc\share</b>. I'm looking to get the string outputs of these commands and store them into an environment variable for further evaluation of the output. Only all the standard ways like piping and redirecting don't work generating various error messages.

If any one knows how to do this seamingly simple task, I would be very appreciative of their reply.

Thanks
Gary

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

How do I Send a batch command's output t

by rvkempen In reply to How do I Send a batch com ...

On the NT resource CD there is a script tool called kixtart.
It is mostly used for login scripts, but should work fine in all other situations.
In this language you can assign variables, and assign values for evaluating to it.

This should be the answer to your problems, and a good tool for creating login scripts.

If you do not have the resource kit, just search altavista, and sites where you can download it will show up

grtx Ron

Collapse -

How do I Send a batch command's output t

by garyg In reply to How do I Send a batch com ...

The question was auto-closed by TechRepublic

Collapse -

How do I Send a batch command's output t

by baird_k In reply to How do I Send a batch com ...

If you are looking to pipe the command to a text file, you simply have to use the following command.

"net use * \\unc\share >> c:\name.txt

You can open the text file that you have created on the c:\drive to reveal the computer's response. If you need help creating an environment variable, just drop me a line.

KB

Collapse -

How do I Send a batch command's output t

by garyg In reply to How do I Send a batch com ...

The question was auto-closed by TechRepublic

Collapse -

How do I Send a batch command's output t

by Andreas In reply to How do I Send a batch com ...

Try this:
FOR /F "tokens=*" %%I in ('net use x: \\server\share') do set output=%%I

The output of the command is now stored in:
%output%

Was this what you where looking for?

Collapse -

How do I Send a batch command's output t

by garyg In reply to How do I Send a batch com ...

The question was auto-closed by TechRepublic

Collapse -

How do I Send a batch command's output t

by garyg In reply to How do I Send a batch com ...

This question was auto closed due to inactivity

Back to Windows Forum
7 total posts (Page 1 of 1)  

Operating Systems Forums