in reply to Using a variable for PATHNAME in exec()
I have this working with both Win32::Process and backticks.. my code looks a lilttle like this...
to get the path (ie $xcall_path I had to do something like so..Win32::Process::Create($ProcObj, "$xcall_path/bin/$prog", "$prog \"$type\" \"$file\" \"$call_num\"", 0, # Don't inherit. NORMAL_PRIORITY_CLASS, ".") or &Update_Log("DEBUG - Cannot Launch the Service Desk Pr +ocess process in the Log Call Routine: $!\n$prog\"$type\" \"$file\" \ +"$call_num\"\n"); if ($ProcObj->Wait (180*1000)){ # execution of the process is successfully. $ProcObj->Kill(0); } else { # process has hung up for some reason $ProcObj->Kill(255); $rc = 0; }
As I said I have had no problems with this. Perhaps look at the substitues of \'s with /'s -----my $path = "$ENV{'MYSYSENV'}\\X-CallLogger"; unless ($xcall_path = Win32::GetShortPathName($path)) { &Event(EVENTLOG_ERROR_TYPE, "$0 - Path Problems in Setup for $ +path: $^E\n"); return(0); } $xcall_path =~s /\\/\//g; #Substitute backslashes with +frontslashes $prog = $ARGV[0];
|
|---|