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);
In reply to Re: need vb script to be perl
by GrandFather
in thread need vb script to be perl
by JFarr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |