winrs using backtick in perl hangs

149 views Asked by At

I ran the following winrs command using backtick (``) in perl script,

$result = `winrs -r:<system_name> d:\tmp\transfer_remove_file.bat`

winrs windows is hangs after executing and it didn't return the output, after I close the window, I am able to see the output of winrs command.

As I need to capture the winrs result, I am using backtick, if I use system() call, it is not hanging, but i am not able to capture the output.

I can redirect the output of winrs to a file and use system(), like as follow,

system( winrs -r:<system_name> d:\tmp\transfer_remove_file.bat >> testlog.txt )

but when using multiple winrs in the same script and doing the redirect to same file, getting the following error

the process cannot access the file because it is being used by another process.

Please help me to address this issue

0

There are 0 answers