vbscript - Handle an argument beginning with "//" -
this question has answer here:
passing argument beginning // (e.g. //abc) vbs file (wscript) results in "unknown option" error.
how can catch , handle error?
look at
option explicit dim = 0 wscript.arguments.length - 1 wscript.echo i, wscript.arguments(i) next output:
cscript 45765234.vbs 1 2 3 /a /b /c //d \\abc 0 1 one 2 two 3 three /a 4 /b 5 /c 6 \\abc e:\work\proj\soa\tmp cscript 45765234.vbs 1 2 3 /a /b /c //d //abc eingabefehler: es wurde die unbekannte option "//abc" angegeben. and:
cscript syntax: cscript skriptname.erweiterung [option...] [argumente...] optionen: //b batch-modus: zeigt keine skriptfehler und aufforderungen //d aktives debuggen aktivieren //e:engine modul zum ausführen des skripts verwenden //h:cscript Ändert den standardskripthost auf cscript.exe um //h:wscript Ändert den standardskripthost auf wscript.exe um (standard) //i interaktiver modus (standard; gegenteil von //b) //job:xxxx führt einen wsf-auftrag aus //logo zeigt das logo (standard) //nologo zeigt kein logo an: bei ausführung wird kein banner angezeigt //s speichert die aktuellen befehlszeilenoptionen für diesen benutzer //t:nn timeout in sekunden: maximale zeit, die ein skript laufen darf //x führt das skript im debugger aus //u unicode für umgeleitete e/a-vorgänge von der konsole aus verwenden and see: can't use // or catch them in script, because handled host (cscript.exe, wscript.exe). using \, however, causes no problems.
Comments
Post a Comment