我编写了一个旨在创建 CSV 文件的 jscript 脚本。理论上我应该这样使用它:
myscript>foo.csv
但是 CSV 文件被“Microsoft (R) Windows Script Host Version 5.8 etc.”损坏。标识。
我知道我可以写:
cscript //nologo myscript>foo.csv
但这是生产力和可读性的损失。
你有更好的解决方案吗?
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
所以使用
cscript //Nologo //S
Command line options are saved.