FATIHTALI 0 Posted March 19, 2009 Share Posted March 19, 2009 CODE$var = StringRight(@ComputerName, 1) IF Not $var = "N" then $rc = _RunDos("powercfg /HIBERNATE OFF") MsgBox(0, "", "This computername end with:"&$var) endif MsgBox(0, "", "this is not notebook") I am recieving everytime this is not notebook error. If not doesnt work. what is wrong. "not" command deleted from program. I didnt found in help. Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights. Link to post Share on other sites
Developers Jos 2,852 Posted March 19, 2009 Developers Share Posted March 19, 2009 IF Not ($var = "N") then or IF $var <> "N" then 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 post Share on other sites
DaRam 2 Posted March 19, 2009 Share Posted March 19, 2009 Put a Msgbox at the beginning to display the @ComputerName to verify that the last character is indeed Not 'N'Use <> "N" instead of NOT and try.I am not sure if you expect the @ComputerName to be 'Notebook' unless it is indeed 'named' so.CODE$var = StringRight(@ComputerName, 1)IF Not $var = "N" then$rc = _RunDos("powercfg /HIBERNATE OFF") MsgBox(0, "", "This computername end with:"&$var)endifMsgBox(0, "", "this is not notebook")I am recieving everytime this is not notebook error.If not doesnt work.what is wrong."not" command deleted from program. I didnt found in help. Link to post Share on other sites
FATIHTALI 0 Posted March 19, 2009 Author Share Posted March 19, 2009 Put a Msgbox at the beginning to display the @ComputerName to verify that the last character is indeed Not 'N'Use <> "N" instead of NOT and try.I am not sure if you expect the @ComputerName to be 'Notebook' unless it is indeed 'named' so.Hello. Our computername standart is if computer is a notebook it name end with "N". Qua1001N or RES0025N like that.If I check Last name it will be enought for me... Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights. Link to post Share on other sites
FATIHTALI 0 Posted March 19, 2009 Author Share Posted March 19, 2009 IF Not ($var = "N") thenor IF $var <> "N" thenIt worked well. Thank you so much.I dont know programing. It is my hoby only. Thanks for help so so much. Startup Agent It is my small Startup Agent. You can install programs on startup Domain pc without Admin rights. Link to post Share on other sites
erik7426 0 Posted March 19, 2009 Share Posted March 19, 2009 It worked well. Thank you so much. I dont know programing. It is my hoby only. Thanks for help so so much. Try $var = StringRight(@ComputerName, 1) If $var <> "N" Then $rc = _RunDOS("powercfg /HIBERNATE OFF") MsgBox(0, "", "This computername end with:" & $var) Else MsgBox(0, "", "this is not notebook") EndIf Link to post Share on other sites
cheeroke 1 Posted July 12, 2016 Share Posted July 12, 2016 I got same problem but with this bit of code: MsgBox(0,'Window','is activated - C2',1) WinWaitActive("Microsoft Visual C++ 2010 x86 Redistributable Setup") If Not (WinActive("Microsoft Visual C++ 2010 x86 Redistributable Setup")) Then WinActive("Microsoft Visual C++ 2010 x86 Redistributable Setup") WinWaitActive("Microsoft Visual C++ 2010 x86 Redistributable Setup") ...why it doesn't want to work? Link to post Share on other sites
AutoBert 223 Posted July 12, 2016 Share Posted July 12, 2016 If Not (WinActive("Microsoft Visual C++ 2010 x86 Redistributable Setup")) Then WinActive("Microsoft Visual C++ 2010 x86 Redistributable Setup") This line is nonsence because is not needed the window is already active. or is needed, but then script hangs already in the line before i suggest correct your windowtitle or better use the hwnd of the window Link to post Share on other sites
Moderators JLogan3o13 1,769 Posted July 12, 2016 Moderators Share Posted July 12, 2016 (edited) @cheeroke If you want to wait until the window is active, your second line should simply be this: WinWaitActive("Microsoft Visual C++ 2010 x86 Redistributable Setup") If the window is there and you want to try to activate it, something like this: If WinExists("Microsoft Visual C++ 2010 x86 Redistributable Setup") Then WinActivate("Microsoft Visual C++ 2010 x86 Redistributable Setup") Edit: Just noticed that you resurrected a 7 year old thread to ask your question. In the future, please start a new thread. Edited July 12, 2016 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to post Share on other sites
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