Hola amigos
A ver, se abrir una instancia de la CMD de 3 maneras y se recibir el
código de salida
puts %x[Tasklist /v | Find "%tmp:~0,30%" >NUL]
response = $?.exitstatus
Eso me funciona.
Pero ahora necesito abrir la consola en modo oculto (Y solo se hacerlo
con el modulo Win32ole), y entonces el [b]exitstatus [/b]me manda error
, no se porque:(:
[code]
require 'win32ole'
shell = WIN32OLE.new('Shell.Application')
shell.ShellExecute('CMD', '/K Tasklist /v | Find "%tmp:~0,30%" >NUL',
'', '', 0)
response = $?.exitstatus
if response == 0
puts "hola"
end
[/code]
[code]undefined method `exitstatus' for nil:NilClass
(NoMethodError)[/code]
on 2012-03-04 16:51
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.