[英]SoundRecorder.exe Executed from Ruby on Windows 7
我正在嘗試從Ruby在Windows 7設備上運行c:\\ windows \\ system32 \\ soundrecorder.exe。 當我運行該應用程序時,出現以下錯誤:“無此文件或目錄”。
我可以成功運行CALC.exe而沒有任何麻煩。
我已驗證我的計算機具有以下文件:
Directory of c:\windows\system32
07/13/2009 08:39 PM 142,336 SoundRecorder.exe
1 File(s) 142,336 bytes
0 Dir(s) 156,940,525,568 bytes free
我正在使用:
@run_command = 'c:\windows\system32\SoundRecorder.exe'
stdin, stdout,stderr =Open3.popen3(@run_command) do |stdin,stdout,stderr,wait_thr|
process_pid = wait_thr[:pid]
p "Process Started for Execute Command: #{process_pid}"
exit_status = wait_thr.value
end
這是我嘗試過的事情:
@run_command
)運行,它起作用了。 **其他調試結果***
irb(main):006:0> Dir.exist? 'c:/windows/system32'
=> true
irb(main):011:0> File.exist? 'c:/windows/system32/calc.exe'
=> true
irb(main):012:0> File.exist? 'c:/windows/system32/SoundRecorder.exe'
=> false
HOWEVER before anyone says, "XXX, the file doesn't exist look here"
C:\>dir c:\windows\system32\SoundRecorder.exe
Volume in drive C is OS
Volume Serial Number is F099-27F4
Directory of c:\windows\system32
07/13/2009 08:39 PM 142,336 SoundRecorder.exe
1 File(s) 142,336 bytes
0 Dir(s) 156,942,340,096 bytes free
這是Windows問題的100%。
將文件復制到其他任何地方,然后運行它。
有用。 我不知道為什么
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.