Veritas-bu

Re: [Veritas-bu] More a Windows scripting question...but NBU related

2007-10-18 15:23:08
Subject: Re: [Veritas-bu] More a Windows scripting question...but NBU related
From: "Ron Jack \(Systems Network\)" <rjack AT nando DOT com>
To: <Veritas-bu AT mailman.eng.auburn DOT edu>
Date: Thu, 18 Oct 2007 15:02:00 -0400
for /F "tokens=*" %%I in ('command') do set output=%%I
 
Remember, two %s in a batch file, one % on the command line.
 
C:\>for /F "tokens=*" %I in ('time /T') do set var=%I
 
C:\>set var=3:01p
 
C:\>echo %var%
3:01p
 
C:\>
 
 
-----Original Message-----
From: veritas-bu-bounces AT mailman.eng.auburn DOT edu [mailto:veritas-bu-bounces AT mailman.eng.auburn DOT edu]On Behalf Of Ellis, Jason
Sent: Thursday, October 18, 2007 2:22 PM
To: Veritas-bu AT mailman.eng.auburn DOT edu
Subject: [Veritas-bu] More a Windows scripting question...but NBU related

So I need to run a command and then store the output of that command in a variable for later use. In UNIX this is easy, just put the command into back-quotes and place it in the variable you want the results to be stored in. It doesn’t work this was in the Windows shell.

 

Is there anybody out there who knows how to do this in Windows?

 

Thank you.

 

Jason

_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu