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);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: need vb script to be perl
by pKai (Priest) on Feb 01, 2007 at 21:43 UTC | |
by GrandFather (Saint) on Feb 01, 2007 at 21:49 UTC |