Posted By

mitry on 07/25/08


Tagged

jscript cmd bung


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

mitry
laurenceosx


Running JScript in a CMD File


 / Published in: JavaScript
 

URL: http://blogs.msdn.com/joshpoley/archive/2008/01/15/running-jscript-in-a-cmd-file.aspx

embed the JScript code in a .cmd file

  1. @set @cmdinterop=1 /*
  2. @set @cmdinterop=
  3. @%SystemRoot%\system32\cscript.exe //NoLogo //E:JScript "%~f0" %* & exit /b
  4. */
  5. // JScript start here:
  6. var today = new Date();
  7. WScript.Echo(today);

Report this snippet  

You need to login to post a comment.