in reply to Re^2: More Perl/Tk Queries with Spawned Processes under Win32
in thread More Perl/Tk Queries with Spawned Processes under Win32
You could allow the shell to do the path resolution for you:
Win32::Process::Create( $obj, "C:\\windows\\system32\\cmd.exe", 'cmd /c notepad somefile', 0, NORMAL_PRIORITY_CLASS, '.' ) or die $^E;;
Or more simply use system
## Run the command asyncronously with shell command resolution $pid = system 1, 'notepad'; .... ## Do other stuff ## Retrieve the exit code waitpid $pid, 0; print 'command return status: ', $? >> 8;; command return status: 0
|
|---|