0

I wrote a jscript script intended to create a CSV file. In theory I should use it like this:

myscript>foo.csv

But the CSV file gets corrupted by "Microsoft (R) Windows Script Host Version 5.8 etc." logo.

I know I can write:

cscript  //nologo myscript>foo.csv

but it is a loss of productivity and readability.

Do you have a better solution?

antonio
  • 10,629
  • 13
  • 68
  • 136
  • Related: [Permanent removal of logo in Windows Scripting Host (WSH) scripts](http://stackoverflow.com/q/17389335/113116) – Helen Jul 04 '13 at 12:34

1 Answers1

2
cscript /?
Usage: CScript scriptname.extension [option...] [arguments...]

Options:
 //B         Batch mode: Suppresses script errors and prompts from displaying
 //D         Enable Active Debugging
 //E:engine  Use engine for executing script
 //H:CScript Changes the default script host to CScript.exe
 //H:WScript Changes the default script host to WScript.exe (default)
 //I         Interactive mode (default, opposite of //B)
 //Job:xxxx  Execute a WSF job
 //Logo      Display logo (default)
 //Nologo    Prevent logo display: No banner will be shown at execution time
 //S         Save current command line options for this user
 //T:nn      Time out in seconds:  Maximum time a script is permitted to run
 //X         Execute script in debugger
 //U         Use Unicode for redirected I/O from the console

So use

cscript //Nologo //S
Command line options are saved.
Ekkehard.Horner
  • 38,498
  • 2
  • 45
  • 96
  • +1 I wrote a batch file with lines like this: `ftype jsfile="%SystemRoot%\System32\CScript.exe" //nologo "%%1" %%*`. All in all your solution seems easier. BTW, do you know where in the registry (or mmaybe somewhere else) `cscript` options are saved? Does `cscript //Nologo //S` requires command prompt with elevated privileges? – antonio Jun 28 '13 at 13:17