Re: choice wscript or cscript in .vbs



On May 14, 1:32 pm, "zloup" <zl...@xxxxxxxx> wrote:
thank you
but j want clic on the script !!! and not tape

"Pegasus (MVP)" <I....@xxxxxxxxxx> a écrit dans le message de news:
eOO%23oUetIHA.5...@xxxxxxxxxxxxxxxxxxxxxxx



"zloup" <zl...@xxxxxxxx> wrote in message
news:482b0ebf$0$837$ba4acef3@xxxxxxxxxxxxxxxxx
Hello

How to choice wscript or cscript in a .vbs.
i want cscript when i go a script on an unknow PC, when i don't know the
script for default

thank you

Precede the script name with "cscript.exe":
cscript //nologo zloup.vbs

One way to do that on an arbitrary machine is to Right-click, select
Open with, Choose program and then select "Microsoft (R) Console Based
Script Host" from the Other programs section of the dialog box.

I tested this in WinXP. The exact steps might very on other versions
of Windows.

Another way is to first go to Start/Run and key in ...

cscript //h:cscript

and click OK. This will set the default host to cscript.exe until
sush time as it is altered with a line like ...

cscript //h:Wscript

After this, clicking on a VBS file in explorer will execute it under
cscript.exe - though a console window will open, you will not see any
output from the script, if it has any ECHOs in it (the action of GUI
Popups or Msgboxs is unchanged). ECHOed output appears only if the
script is executed as Pegasus suggested - in an already opened
console window.

If you would like to see a GUI confirmation message when converting
from one host to the other use Wscript at the Run line in place of the
first cscript.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.



Relevant Pages

  • RE: VBScript in SQL Server Agent/Jobs not working
    ... Basically, Windows Scripting Host has two script calling executibles, WScript ... the .VBS or .JS extension and call it with WScript or CScript. ...
    (microsoft.public.sqlserver.server)
  • Re: ouput 100 lines from .wsf when using WScript
    ... > Hi Rob, ... > If they just need to see a list, I'd suggest using CScript, just create ... CScript as my default host. ... This script Torgeir hyperlinks to contains just what I needed. ...
    (microsoft.public.scripting.wsh)
  • Re: Scripting hosts backwards on my system
    ... the //H switch sets the default host which will be used when a script is ... Copyright Microsoft Corporation 1996-2001. ... even though CScript was long ago ...
    (microsoft.public.scripting.vbscript)
  • Re: Scripting hosts backwards on my system
    ... the //H switch sets the default host which will be used when a script ... Copyright Microsoft Corporation 1996-2001. ... even though CScript was long ago ...
    (microsoft.public.scripting.vbscript)
  • Re: cscript errors when running many concurrent vbs scripts
    ... > i have a java application that spawns cscript to run a simple vbs ... > Script Host failed. ... > processes from java), i'm looking into writing a c++ dll that makes ...
    (microsoft.public.scripting.wsh)

Loading