
sloppyjoe72
Members-
Posts
9 -
Joined
-
Last visited
Everything posted by sloppyjoe72
-
How do I pass along stored info?
sloppyjoe72 replied to sloppyjoe72's topic in AutoIt General Help and Support
I tried looking but couldn't find it. So that I know for future reference, where is it located in the help file? -
Hello all, I've started writing a script to help manage the remote desktop connections we make a work a little easier. I'm starting out the script small, but hoping to learn enough to make it somewhat advanced. For now, I'm having an issue. Here's the script: $svrip = InputBox ("Question", "Enter the IP of the server") Run("mstsc.exe /V:") Exit The first line asks for the IP address of the server (which I hope to later be able to select from a list). In the second line, mstsc is the executable for remote desktop. the /V: command is supposed to be followed by the IP address of the server. My issue is I don't know how to pass along that info. I've tried Run("mstsc.exe /V:$svrip"), but it doesn't seem to like that. I've also tried Run("mstsc.exe /V:")$svrip, but it doesn't like that either. How can I pass along the IP address to the switch for the remote desktop connection? TIA Sloppy
-
Help with Yes or No dialog box
sloppyjoe72 replied to sloppyjoe72's topic in AutoIt General Help and Support
edited my above post to show the new code :-) -
Help with Yes or No dialog box
sloppyjoe72 replied to sloppyjoe72's topic in AutoIt General Help and Support
Something like this?: Run("TZEdit.exe") WinWaitActive("Windows Time Zone Editor" , "Daylight Saving Time") Send("{TAB 2}") Send("{ENTER}") WinWaitActive("Edit Time Zone" , "Time Zone &Name:") Send("{TAB 5}") Send("{DOWN}") Send("{TAB 2}") Send("{UP}") Send("{TAB 5}") Send("{UP 4}") Send("{TAB 2}") Send("{DOWN}") MsgBox(4, "Verify", "Please verify that the settings in the TZEDIT tool are correct. The Start Day should read the 2nd Sunday in March and the Last Day should be the 1st Sunday in November. Does TZEdit match these settings?") $ans = MsgBox(6,.,..) If $ans = 6 then Send("{TAB 7}") Send("{ENTER}") Send("{TAB 4}") Send("{ENTER}") endif If $ans = 7 then MsgBox(0, "Error", "Please manually change the information in the TZEdit tool. The Start Day should be the 2nd Sunday in March and the Last Day should be the 1st Sunday in November. Please change this information befopre clicking the OK button.") endif exit I now understand that I had parts of the script that were useless, though I can't seem to figure out what to put in for "$ans = MsgBox(6,.,..)" I checked the help file, but can't find anything on this syntax Thanks again, and I'm tryin'! -
I'm trying to create a simple front end for the TZEdit tool. I know that one has already been created and posted on here, but I'm trying to write my own scripts to see how well I can do. Here's the code: CODERun("TZEdit.exe") WinWaitActive("Windows Time Zone Editor" , "Daylight Saving Time") Send("{TAB 2}") Send("{ENTER}") WinWaitActive("Edit Time Zone" , "Time Zone &Name:") Send("{TAB 5}") Send("{DOWN}") Send("{TAB 2}") Send("{UP}") Send("{TAB 5}") Send("{UP 4}") Send("{TAB 2}") Send("{DOWN}") MsgBox(1, "Verify", "Please verify that the settings in the TZEDIT tool are correct. The Start Day should read the 2nd Sunday in March and the Last Day should be the 1st Sunday in November. Does TZEdit match these settings?") $yes1 = GUICtrlCreateButton ("Yes", 10, 30, 50) GUICtrlSetOnEvent(-1 , "affirm") $no1 = GUICtrlCreateButton ( "No", 0, -1) GUICtrlSetOnEvent(-1 , "deny") GUISetState(@SW_SHOW) ; Just idle around While 1 Sleep(10) Wend ; END Func affirm() Send("{TAB 7}") Send("{ENTER}") Send("{TAB 4}") Send("{ENTER}") EndFunc Func deny() MsgBox(0, "Error", "Please manually change the information in the TZEdit tool. The Start Day should be the 2nd Sunday in March and the Last Day should be the 1st Sunday in November. Please change this information befopre clicking the OK button.") EndFunc exit Everything works ok right up until I display the Yes or No dialog box. The box displays, but the buttons don't do anything and the script just stops. I've figured out that I'm not getting the codes that are returned from pressing the yes or no buttons, but I don't know how to capture them. I've searched the help file, but can't find anything that points me in the right direction. All of the keypresses are ok, and the program runs fine without the dialog box. I just want to put it in on the off chance that the machine's date and time setting aren't configured properly Thanks again for the help, and if this was answered in another thread, just point me at it. :-)
-
CODERun("C:\program files\Spector\Get_NIC_Address.exe") Do $title = WinGetTitle("", "NIC") Sleep(100) Until $title = "Get_MAC_And_ComputerName" If $title = "Get_MAC_And_ComputerName" Then Send("{ENTER 2}") Run("notepad.exe C:\fsi\spector\spector.ini") Sleep(500) Run("cmd.exe") Sleep(1000) Send("ipconfig /all") Send("{ENTER}") WinWaitClose("Spector.ini - Notepad") Run("C:\program files\Spector\spector.exe") Else If $title = "Update SQL With NIC and Computer Name" Then Send("{ENTER}") Run("C:\program files\Spector\spectrum.exe") EndIf EndIf Managed to hobble this together off someone else's example on the site. The first half runs successfully, but I'm not able to test the second half. The only thing I wish I could script better is waiting for the dos box to be active. Will try and tackle it tomorrow, but always open to suggestions
-
Here's what I have so far, sorry for not posting it sooner CODERun("C:\program files\Spector\Get_NIC_Address.exe") $text = WinGetTitle("", "") If $text = ("NOT found in Spector Database") Then Run("notepad.exe C:\program files\spector\spector.ini") Sleep(500) Run("cmd.exe") Sleep(500) Send("ipconfig /all") Send("{ENTER}") WinWaitClose("Spector.ini - Notepad") Send("{ENTER 2}") Run("C:\program files\Spector\spector.exe") ElseIf $text = ("NIC Address and Computer Name updated Successfully") Then Send("(ENTER)") Run("C:\program files\Spector\spector.exe") EndIf Not sure what I'm doing wrong, as it just goes right on throught line by line as if it ignores the "WinGetTitle" line. I don't need this program to loop, as it can only encounter one of two different dialog boxes which will always come up. Thanks again Sloppy
-
Sorry, but I'm new to this and don't understand any of what you wrote. Here's the info for the dialog boxes. The first one (if it appears) I just need autoit to send the enter command and run a program: >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Update SQL With NIC and Computer Name Class: #32770 Size: X: 231 Y: 249 W: 344 H: 126 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 397 Y: 343 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0xECE9D8 Dec: 15526360 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 131 Y: 60 W: 75 H: 23 Control ID: 2 ClassNameNN: Button1 Text: OK Style: 0x50030001 ExStyle: 0x00000004 >>>>>>>>>>> Status Bar Text <<<<<<<<<<< >>>>>>>>>>> Visible Window Text <<<<<<<<<<< OK NIC Address and Computer Name updated Successfully. >>>>>>>>>>> Hidden Window Text <<<<<<<<<<< --------------------- These are what come up if the program fails: >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Get_MAC_And_ComputerName Class: #32770 Size: X: 237 Y: 332 W: 555 H: 119 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 529 Y: 427 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0xD4D0C8 Dec: 13947080 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 237 Y: 60 W: 75 H: 23 Control ID: 2 ClassNameNN: Button1 Text: OK Style: 0x50030001 ExStyle: 0x00000004 >>>>>>>>>>> Status Bar Text <<<<<<<<<<< >>>>>>>>>>> Visible Window Text <<<<<<<<<<< OK Your NIC Card Address '0011439EBC9B' Was NOT found in the Database. >>>>>>>>>>> Hidden Window Text <<<<<<<<<<< ----You click ok, then get this dialog box ----- >>>>>>>>>>>> Window Details <<<<<<<<<<<<< Title: Update SQL With NIC and Computer Name Class: #32770 Size: X: 344 Y: 332 W: 344 H: 119 >>>>>>>>>>> Mouse Details <<<<<<<<<<< Screen: X: 524 Y: 426 Cursor ID: 2 >>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<< RGB: Hex: 0xD4D0C8 Dec: 13947080 >>>>>>>>>>> Control Under Mouse <<<<<<<<<<< Size: X: 131 Y: 60 W: 75 H: 23 Control ID: 2 ClassNameNN: Button1 Text: OK Style: 0x50030001 ExStyle: 0x00000004 >>>>>>>>>>> Status Bar Text <<<<<<<<<<< >>>>>>>>>>> Visible Window Text <<<<<<<<<<< OK NIC Address and Computer Name updated Successfully. >>>>>>>>>>> Hidden Window Text <<<<<<<<<<< This second one is where I would need it to send enter to the first two dialog boxes, open an ini file, then run an ipconfig /all in a dos box. After closing the .ini file, the autoit script would then run the same program as if it completed successfully. I know that I'd have to use a WinWaitClose for the notepad window, but I have no idea how to write the script to get the info from the dialog box and then direct the script to the right course of action. Hope this helps, and thanks a lot! I've tried to understand this, but I'm just getting into any sort of programming. So far, I've done ok with simple straightforward scripts, but I have no idea on this one. Even if someone gives me a good solid simple script (no offense PerryRaptor) I'd be willing to try and hack away at it to figure out how this works. Thanks again SloppyJoe
-
I don't know where to start with this one, so I figured I'd ask. I'm looking to write a simple script that will check the text in a message box, and depending on what the box says preform one of two actions. I've lurked enough to know how to write in the actions, but not to create the script to check the message box. The box that comes up shows that the action was completed successfully or failed. The problem is that the title of the box and the text in it are different depending on if the action succeedes or fails. I don't need this to be a loop, I only need it to run once. Thanks for the help sloppyjoe