Windows Vista Forums

Determine if script was run from command prompt

  1. #1


    cwhankey Guest

    Determine if script was run from command prompt

    How can I determine in my VBScipt whether the script was run from the
    command prompt or from double clicking in Windows Explorer? I want to
    pause the script at the end if it was run from the command prompt but
    Wscript.StdIn.ReadLine errors if it the script is not run as with the
    console.

      My System SpecsSystem Spec

  2. #2


    Tom Lavedas Guest

    Re: Determine if script was run from command prompt

    On Oct 17, 10:43*am, cwhan...@xxxxxx wrote:

    > How can I determine in my VBScipt whether the script was run from the
    > command prompt or from double clicking in Windows Explorer? *I want to
    > pause the script at the end if it was run from the command prompt but
    > Wscript.StdIn.ReadLine errors if it the script is not run as with the
    > console.
    The WSH.Name property returns the name of the host executable that was
    invoked to run the script. In general, WScript.exe is the GUI host
    and cscript.exe is the console host. These names could be changed,
    but 99.44% of the time this should be accurate.

    Tom Lavedas
    -------------------

      My System SpecsSystem Spec

Determine if script was run from command prompt

Similar Threads
Thread Forum
Command Prompt doesnt seem to recognize the command line!!
Hello, I'm trying to split a .flv file by using flvparse, which is a Windows-only, command-line interface tool. I did get through to the directory...
Network & Sharing
best way to determine if a command history exists?
The only remaining concern I have for my prompt function is to find some way to recode the line that reads if ( 'x' -eq ('x' + $h) ) {return $p}...
PowerShell
Wanting persistent variables from script at PS command prompt
Hi, While sitting at a Powershell shell prompt, I would like to execute a script and have all its variables remain accessible to the shell after...
PowerShell
Make a command prompt run a command as soon as it opens?
Hey guys. Ive been trying to figure out how to make a command prompt run a command line as soon as the box comes up. I need this to happen...
General Discussion
My command works in the PS prompt but not in a script (.ps1) / reg
Hi, If I define these variables in the prompt: $var1 = "some" $var2 = "thing" .... and then run the command: Get-QADUser -SearchRoot...
PowerShell
how to determine a script location?
Inside a basic .PS1 script how do I determine the location of the PS1. What i am doing is I want to locate a config file which will be located in...
PowerShell
Every time I run script from command prompt I get restricte cert e
Here is the error: profile.ps1 is not digitally signed. The script will not execut I read the help file for this and it mentions making a...
PowerShell