# 为了更好控制批处理文件执行,用ruby与bat交互.
require 'Win32API'
# wrap win32 api
system = Win32API.new("msvcrt","system",['p'],'i')
# execute bat
ret = system.call("w.bat")
if ret != 0
puts "Error occured!"
end
system.call("pause")
# 为了更好控制批处理文件执行,用ruby与bat交互.
require 'Win32API'
# wrap win32 api
system = Win32API.new("msvcrt","system",['p'],'i')
# execute bat
ret = system.call("w.bat")
if ret != 0
puts "Error occured!"
end
system.call("pause")