Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

execute a vbscript from a perl script.

by hpomw (Initiate)
on Sep 06, 2012 at 14:38 UTC ( #992108=perlquestion: print w/replies, xml ) Need Help??
hpomw has asked for the wisdom of the Perl Monks concerning the following question:

Hello Experts,

I have a simple perl script to check the last modified time of a file and if files's time was not modifed in last 5 minute as a next course of action i wan to execute a vb script.

i tried

my $cmd = "cscript C:\\ProgramData\\HP\\HP BTO Software\\bin\\instrumentation\\Failover.vbs";

and then used qx($cmd);

but this script will not be executed.

Could you help me with this?


Replies are listed 'Best First'.
Re: execute a vbscript from a perl script.
by Abe (Acolyte) on Sep 06, 2012 at 14:50 UTC

    Shouldn't there be escaped quotes round the path to the vbs?

    cscript will think it's getting 3 parameters as things stand

      Hi Abe, Could you reply with how should it look like as per you? -KAKA-

        Maybe you could try to add quotes yourself instead of making others do your work for you?

Re: execute a vbscript from a perl script.
by aitap (Deacon) on Sep 06, 2012 at 18:10 UTC
    but this script will not be executed.
    Does it print anything? Did you check $? or $! for error codes or explanations?
    $ perl -E'qx(thereisnosuchcommand); say "$? $!"' -1 No such file or directory
    Sorry if my advice was wrong.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://992108]
Front-paged by Corion
[shmem]: Re^5: Understanding endianness of a number - nice! "zigamorph" will be the host name of the VM I'll set up to debug Microfocus COBOL/perl stuff :-D
[prospect]: Hi, to avoid cluthering the Seekers of Perl Wisdom page. I wanted to print out the values on a new line each. So I though I put a . "\n" behind "print foreach func()" but something interesting happens and it I just get "5" as output :p
[prospect]: print foreach func(). "\n"; sub func { return ( 1, 2, 3, 4, 5 ); }

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (11)
As of 2017-07-24 10:19 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (350 votes). Check out past polls.