Re: Returning a value from a VBScript
- From: Matthias Tacke <Matthias@xxxxxxxx>
- Date: Thu, 13 Sep 2007 17:06:40 +0200
Pegasus (MVP) wrote:
"thecomputerguy74" <rgblois@xxxxxxxxx> wrote in message news:1189682751.346860.293120@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxIf you need more digits as errorlevel allows (AFAIK 16 bit signed integer)I have searched the web for this, and maybe I'm using the wrong search
terms. I am trying to figure out how to return a value from my
VBScript for use by another script, batch file, or other command. All
I ever seem to find is how to return a value from a function, which
does me now good.
Any help would be appreciated. I'm sure it's not difficult, but I
don't know how to do it.
Thank you.
thecomputerguy74
Try this extremely simplified example:
@echo off
MyScript.vbs
echo MyScript.vbs returned an ErrorLevel of %ErrorLevel%
MyScript.vbs could contain this line:
WScript.Quit(2007)
you can parse standard output of cscript in a batch:
@echo off
echo wscript.echo date-1>tmp.vbs
for /f %%a in ('cscript tmp.vbs //Nologo') do set "yesterday=%%a"
echo Yesterday=%yesterday%
DEL tmp.vbs
This task is much more complicated in pure batch (albeit possible)
--
Greetings
Matthias
.
- Follow-Ups:
- Re: Returning a value from a VBScript
- From: Tom Lavedas
- Re: Returning a value from a VBScript
- References:
- Returning a value from a VBScript
- From: thecomputerguy74
- Re: Returning a value from a VBScript
- From: Pegasus \(MVP\)
- Returning a value from a VBScript
- Prev by Date: RE: Determine what permissions a group has?
- Next by Date: help writting script to copy file to every desktop
- Previous by thread: Re: Returning a value from a VBScript
- Next by thread: Re: Returning a value from a VBScript
- Index(es):
Relevant Pages
|
Loading