in reply to Re^2: perl and wscript
in thread perl and wscript

But It seems that somehow perl and wscript are not communicating well with each other.

Why/how are you expecting them to communicate? system is not used for communication

$ perl -e " system qw[ cscript //?]" CScript Error: Windows Script Host access is disabled on this machine. + Contact your administrator for details.
wscript uses a popup dialog with same message :)

Replies are listed 'Best First'.
Re^4: perl and wscript
by Anonymous Monk on Feb 07, 2011 at 11:07 UTC
    with autodie
    $ perl -Mautodie=system -e " system qw[ wscript //? ]" "wscript" unexpectedly returned exit value 1 at (eval 10) line 13 at -e line 1 $ perl -Mautodie=system -e " system qw[ cscript //? ]" CScript Error: Windows Script Host access is disabled on this machine. + Contact your administrator for details. "cscript" unexpectedly returned exit value 1 at (eval 10) line 13 at -e line 1
Re^4: perl and wscript
by rango (Initiate) on Feb 07, 2011 at 11:49 UTC
    As the VB scripts can be invoked using cscript/wscript <name_of_your_VB_script>, Hence my assumption is to be able to invoke cscript/wscript in the same fashion by using Perl's system function.

    This time i tried with cscript by invoking

    cscript //h:cscript

    Now Getting error.

    C:\Perl\bin>perl -e "system qw[ cscript c:\\blahblah.wsf]"

    Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved.

    [IGN-]2011-02-07 03:19:47[-IGN][FAIL] StartScript: Unable to create controller object - 1A8 <----

      As you have shown and seen yourself, you are invoking successfully with system, the problem is not perl related