Expand|Select|Wrap|Line Numbers
- my $success = undef;
- my $cmdline = EBDTools::os_path("${nh_home}/web/aview/modules/svcrsp-ng/saSync.pl");
- $success = Win32::Spawn($^X, "${^X} $cmdline ${optfile}", $pid);
- if (! $success) {
- my $lasterr = Win32::GetLastError();
- return_configerror("Failed to create commit / sync process (${lasterr}): ${^X} ${cmdline}");
- }
Expand|Select|Wrap|Line Numbers
- echo helloworld > c:\helloworld.txt
Expand|Select|Wrap|Line Numbers
- my $success = Win32::Spawn('d:\\eHealth60\bin\helloworld.bat', undef, $pid);
- if (! $success) {
- my $lasterr = Win32::GetLastError();
- my $msg = Win32::FormatMessage($lasterr);
- Log("medium", "helloworld failed to execute. Reason = $msg.", $Log::LOG_CALLER_NAME);
- }
Can anyone help me with this? Does anyone have another method for me to try because ultimately what I require is a process spawned by Win32::Spawn to call another batch file / binary on a sytem and either write the output to a file so after the Win32::Spawn I can retrieve the value or if I could call using back tick (' ') I could then receive the value of the batch file / binary back to my executing program.
Any and all help is greatly appreciated. I no nothing else to try :(
Thanks, -Andy