Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch.nt    |    Fun with Windows NT batch files    |    68,980 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 67,961 of 68,980    |
|    John Stockton to All    |
|    Return value from a CScript call?    |
|    11 Nov 22 15:35:57    |
   
   From: dr.j.r.stockton@gmail.com   
      
   I have a batch file containing this line :-   
    CScript //nologo THING.JS   
      
   That *.JS file finishes with :-   
    WScript.echo(S)   
      
   so that I can read the answer S in a small window.   
      
   How, most straightforwardly, can I get the value of S (an alphanumeric string   
   of 10 characters) back to the batch file, for example as a local environment   
   variable accessible as %FRED% ??   
      
   I have thought of using something like (untested)   
    CScript.echo("set FRED=" + S),   
   redirecting that output to a file ALEC.BAT, and executing that; but there   
   should be a better way.   
      
   Speed is of no importance; it will typically be executed once a day at login   
   time. I do NOT want to rewrite THING.JS in pure Batch code.   
      
   --   
    (c) John Stockton, near London, UK. Using Google Groups. |   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca