confutatis Posted September 28, 2005 Share Posted September 28, 2005 Hello to all, I'd like to be able to run "plink.exe" using the command processor. The problem I'm having is I don't want the CMD window to be visible to the user while it's running. I can't figure out how to hide the window--if it's possible at all. Here's the code: #include <GUIConstants.au3> #include <file.au3> #include <string.au3> #include <date.au3> #include <constants.au3> ;#include <ie.au3> Opt("WinTitleMatchMode",4) Opt("WinDetectHiddenText",1) $file1=FileOpen("\\evep\test$\pc_log.txt",1) $pc_name=@ComputerName $begin = TimerInit() Run(@ComSpec & " /C \\evep\test$\plink.exe -load "& '"ept via internet"'&" -l "&'"xxx"'&" -pw &'"xxxxx"'&"") sleep(15000) $dif = TimerDiff($begin)-15000 Send("6 {ENTER}") $rec1=$pc_name&"--->"&@TAB& $dif FileWriteLine($file1,$rec1) FileWriteLine($file1,"=================================================================="&@CRLF&@CRLF) FileClose($file1) I don't want the users to "get in the way" of the running plink command. Any ideas? David Link to comment Share on other sites More sharing options...
Developers Jos Posted September 28, 2005 Developers Share Posted September 28, 2005 (edited) Run ( "filename" [, "workingdir" [, flag[, standard_i/o_flag]]] )Parametersfilename The name of the executable (EXE, BAT, COM, or PIF) to run. workingdir [optional] The working directory. flag [optional] The "show" flag of the executed program: @SW_HIDE = Hidden window @SW_MINIMIZE = Minimized window @SW_MAXIMIZE = Maximized window standard_i/o_flag [optional] Provide a meaningful handle to one or more STD I/O streams of the child process. 1 ($STDIN_CHILD) = Provide a handle to the child's STDIN stream 2 ($STDOUT_CHILD) = Provide a handle to the child's STDOUT stream 4 ($STDERR_CHILD) = Provide a handle to the child's STDERR stream Edited September 28, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
confutatis Posted September 28, 2005 Author Share Posted September 28, 2005 (edited) Hello and thanks for the reply... You know, I swear I tried that and it didn't work...I just tried again and now the window is hidden. Sorry for the waste of space for a question I had already answered. David Edited September 28, 2005 by confutatis Link to comment Share on other sites More sharing options...
Developers Jos Posted September 28, 2005 Developers Share Posted September 28, 2005 (edited) Hello and thanks for the reply...I've tried adding the @SW_HIDE, but still visible.DavidDid you try to run it without @Comspec and using @SW_HIDE ? Edited September 28, 2005 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
confutatis Posted September 28, 2005 Author Share Posted September 28, 2005 Did you try to run it without @Comspec and using @SW_HIDE ?On the subject of the same script...When I go ahead and run this script, for some reason, the "plink.exe" process doe not terminate--I can still see it in Task Manager. Any ideas why it would not end along with the script?David Link to comment Share on other sites More sharing options...
w0uter Posted September 28, 2005 Share Posted September 28, 2005 i thought plink was supposed to connect to an ssh/telnet server and STAY connected. if you really want to kill it use the proccess* functions. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now