Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
wscript and cscript in .vbs
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
karamel  
View profile  
 More options Oct 27 2009, 7:01 pm
Newsgroups: microsoft.public.scripting.wsh
From: "karamel" <kara...@yahoo.fr>
Date: Tue, 27 Oct 2009 20:01:58 +0100
Local: Tues, Oct 27 2009 7:01 pm
Subject: wscript and cscript in .vbs
Hello

I want indicate in the file .vbs the type of interpreteur for execute the
file (cscript or wscript)
i don't want use WSCRIPT //H:CScript //nologo //S

help me please
thank you very much


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mayayana  
View profile  
 More options Oct 27 2009, 9:09 pm
Newsgroups: microsoft.public.scripting.wsh
From: "mayayana" <mayaXXy...@rcXXn.com>
Date: Tue, 27 Oct 2009 16:09:17 -0500
Local: Tues, Oct 27 2009 9:09 pm
Subject: Re: wscript and cscript in .vbs
 If it's local you could define your own file
types. For instance, vb1 and vb2. If you
look in the Registry under HKCR\VBSFile you
should see a DefaultIcon key, an Open key
and an Open2 key. Open is generally wscript
and Open2 is generally cscript. With that info.
you have enough to define your own file-type
keys and icons for each engine.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
karamel  
View profile  
 More options Oct 27 2009, 9:06 pm
Newsgroups: microsoft.public.scripting.wsh
From: "karamel" <kara...@yahoo.fr>
Date: Tue, 27 Oct 2009 22:06:35 +0100
Local: Tues, Oct 27 2009 9:06 pm
Subject: Re: wscript and cscript in .vbs
I know, thank

I want to define in the execute'file for execute in more machine

is-it possible ?

"mayayana" <mayaXXy...@rcXXn.com> a écrit dans le message de news:
uWEqhE0VKHA.1...@TK2MSFTNGP04.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mayayana  
View profile  
 More options Oct 27 2009, 9:11 pm
Newsgroups: microsoft.public.scripting.wsh
From: "mayayana" <mayaXXy...@rcXXn.com>
Date: Tue, 27 Oct 2009 16:11:39 -0500
Local: Tues, Oct 27 2009 9:11 pm
Subject: Re: wscript and cscript in .vbs

> I want to define in the execute'file for execute in more machine

> is-it possible ?

  Once the file is running that decision has already
been made, so I don't see how you'd do it. You'd
have to use the script to write a new script, then
shell to that script and quit.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard Mueller [MVP]  
View profile  
 More options Oct 27 2009, 10:37 pm
Newsgroups: microsoft.public.scripting.wsh
From: "Richard Mueller [MVP]" <rlmueller-nos...@ameritech.nospam.net>
Date: Tue, 27 Oct 2009 17:37:29 -0500
Local: Tues, Oct 27 2009 10:37 pm
Subject: Re: wscript and cscript in .vbs

"karamel" <kara...@yahoo.fr> wrote in message

news:4ae743a6$0$934$ba4acef3@news.orange.fr...

> Hello

> I want indicate in the file .vbs the type of interpreteur for execute the
> file (cscript or wscript)
> i don't want use WSCRIPT //H:CScript //nologo //S

> help me please
> thank you very much

As indicated, you must recognize which program was used, then re-run the
script. Assuming you want the script to use cscript, it will run in another
copy of the shell, so another console will be launched. I found this code:
===========
Dim strArgs, i, objShell

' Code to make sure program runs with cscript host program.
strArgs=""
If (Right(LCase(Wscript.Fullname), 11)= "wscript.exe") Then
    For i = 0 To Wscript.Arguments.Count - 1
        strArgs = strArgs & Wscript.Arguments(i) & " "
    next
    Set objShell=CreateObject("Wscript.Shell")
    objShell.Run objShell.ExpandEnvironmentStrings("%comspec%") & _
        " /k cscript.exe //nologo " & Wscript.ScriptFullname & " " & strArgs
    Wscript.Quit
End If

' The actual VBScript program follows.
Wscript.Echo "Line 1"
Wscript.Echo "Line 2"
Wscript.Echo "Line 3"
Wscript.Echo "Line 4"
==========
In this example I used the /k switch to keep the console open so you can see
anything echoed to the screen. Otherwise, you can use the /c switch and the
new command window will just blink and you won't see anything, including
error messages. With the /k switch you see all messages, but you must enter
"exit" to close the new command window.

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Todd Vargo  
View profile  
 More options Oct 27 2009, 11:40 pm
Newsgroups: microsoft.public.scripting.wsh
From: "Todd Vargo" <tlva...@sbcglobal.netz>
Date: Tue, 27 Oct 2009 18:40:43 -0500
Local: Tues, Oct 27 2009 11:40 pm
Subject: Re: wscript and cscript in .vbs

karamel wrote:
> Hello

> I want indicate in the file .vbs the type of interpreteur for execute the
> file (cscript or wscript)
> i don't want use WSCRIPT //H:CScript //nologo //S

The following code will allow you to force a script to always use CSCRIPT no
matter which host is default. Place it at the top of your script.

' Restart with CSCRIPT.vbs
' Written by Todd Vargo in Windows 98 on May 14, 2008
Set WshShell = CreateObject("WScript.Shell")

If InStr(Ucase(WScript.FullName), "WSCRIPT.EXE") Then
  'Restart using CSCRIPT.EXE
   WshShell.Run "CSCRIPT.EXE //nologo " & _
    Chr(34) & Wscript.ScriptFullName & Chr(34)
   Wscript.Quit
End If

Wscript.Echo "Host is " & WScript.FullName
WshShell.Popup "Script will close in 5 seconds.",5,"Done"

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
karamel  
View profile  
 More options Oct 28 2009, 5:13 pm
Newsgroups: microsoft.public.scripting.wsh
From: "karamel" <kara...@yahoo.fr>
Date: Wed, 28 Oct 2009 18:13:08 +0100
Local: Wed, Oct 28 2009 5:13 pm
Subject: Re: wscript and cscript in .vbs
VERY VERY GOOD

Thank you VERY much

"Todd Vargo" <tlva...@sbcglobal.netz> a écrit dans le message de news:
u3h77Z1VKHA.5...@TK2MSFTNGP05.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hz  
View profile  
 More options Oct 30 2009, 6:44 am
Newsgroups: microsoft.public.scripting.wsh
From: Hz <h...@trashymail.com>
Date: Fri, 30 Oct 2009 07:44:50 +0100
Local: Fri, Oct 30 2009 6:44 am
Subject: Re: wscript and cscript in .vbs

karamel wrote:
> Hello

> I want indicate in the file .vbs the type of interpreteur for execute the
> file (cscript or wscript)
> i don't want use WSCRIPT //H:CScript //nologo //S

I Use this:

If LCase(Right(WScript.FullName, 11)) <> "cscript.exe" Then
        WScript.Echo "Please use CScript to run this script"
        WScript.Quit
End If

--
.::[ Hz ]::.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google