Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: need vb script to be perl

by GrandFather (Saint)
on Feb 01, 2007 at 20:41 UTC ( [id://597818]=note: print w/replies, xml ) Need Help??


in reply to need vb script to be perl

Posting the original working VB is fine, but what does your Perl look like? I'd expect something a little like:

my $objLocator = CreateObject("WbemScripting->SWbemLocator"); my $objWMIService = $objLocator->ConnectServer("es-g01-app01", "root\\ +cimv2", "NDRSMP\\p57571", "Dragon#06"); my $colItems = objWMIService->ExecQuery($wmiQuery); print ("Now establish a scheduled task"); my $objNewJob = objWMIService->Get("Win32_ScheduledJob"); my @objTZone = objWMIService->ExecQuery("Select Bias From Win32_TimeZo +ne"); $strBias = $_->Bias for @objTZone; my $SchdTime = TimeConvert(time, $strBias); $objWMIService = GetObject( "winmgmts:{impersonationLevel=impersonate, (Security)}!\\es-g01-ap +p01\root\cimv2" ); $objNewJob = objWMIService->Get("Win32_ScheduledJob"); my $errJobCreated = $objNewJob->Create("C:\\Rescue21\\install\\fixsnmp +->bat", SchdTime, False , undef, undef, undef, JobID);

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: need vb script to be perl
by pKai (Priest) on Feb 01, 2007 at 21:43 UTC
    ...1\\install\\fixsnmp->bat", SchdTime, Fa...

    ;-)

    s/\./->/g once too often.

      'something like' I said, not exactly like. A global search and replace happened and not all the spurious replaces got fixed :-D.


      DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://597818]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-24 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found