samonlinesuper Posted August 5, 2011 Share Posted August 5, 2011 Dear All, I am new of AutoIT and I create a simple script and wants o Maximize the "Wireshark" windows; so I use Run"...........\wireshark.exe", "", @SW_MAXIMIZE)but it doesn't work. Could anyone help and thank you. Link to comment Share on other sites More sharing options...
hannes08 Posted August 5, 2011 Share Posted August 5, 2011 Run(@ProgramFilesDir & "\Wireshark\wireshark.exe",@ProgramFilesDir & "\Wireshark\") WinWaitActive("The Wireshark Net") WinSetState("The Wireshark Net","", @SW_MAXIMIZE) Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
Exit Posted August 5, 2011 Share Posted August 5, 2011 Run"...........\wireshark.exe", "", @SW_MAXIMIZE) It depends on those "...........". It is different in x86 and x64 Systems and in which mode its running. Just search for the executable like here: Opt("ExpandEnvStrings", 1) $wiresharkdir = "" if FileExists("%ProgramFiles%\Wireshark\wireshark.exe") Then $wiresharkdir = "%ProgramFiles%\Wireshark" if FileExists("%ProgramFiles(x86)%\Wireshark\wireshark.exe") Then $wiresharkdir = "%ProgramFiles(x86)%\Wireshark" if FileExists("%ProgramW6432%\Wireshark\wireshark.exe") Then $wiresharkdir = "%ProgramW6432%\Wireshark" ; MsgBox(262144,"",@lf & $wiresharkdir & @lf,0) Run($wiresharkdir & "\wireshark.exe",$wiresharkdir ,@SW_MAXIMIZE) WinWaitActive("The Wireshark Net","",20) beep() Sleep(500) WinSetState("[last]","", @SW_HIDE) Sleep(500) WinSetState("[last]","", @SW_RESTORE) Sleep(500) WinSetState("[last]","", @SW_MAXIMIZE) App: Au3toCmd UDF: _SingleScript() Link to comment Share on other sites More sharing options...
hannes08 Posted August 5, 2011 Share Posted August 5, 2011 It didn't start maximized on my WinXP32bit from the start so I needed to put the WinWaitActive and WinsetState behind the Run function. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
samonlinesuper Posted August 8, 2011 Author Share Posted August 8, 2011 Dears, Thank you, it works and really appreciated. 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