jnkbcs Posted September 14, 2010 Share Posted September 14, 2010 Ok, here goes. my company has a GUI that runs a bunch of applications by a press of a button. its pretty neat i know. The problem is the tool is outdated and the person who wrote it is no longer with the company. I have taken the challenge and tried to rewrite it so if i left it wont be hard to pick up and customize, i have a few things done mainly the overall look and feel but i am having trouble writing the scripts. i have been reading the docs and i think i need some pointers. 1. What to use instead of GOTO. 2. Use a text box to input and then store it and then use it with other button. 3. if Button A is pressed how do i use a progress bar while its searching (Trying to make it fancy) 4. return results from #3 into two different list boxes. or just combine and make one. (Prob do that) Here is the file i am working on: powerscript.au3 This is what the layout looks like: any help or pointers would be greatly appreciated. Link to comment Share on other sites More sharing options...
Jat421 Posted September 14, 2010 Share Posted September 14, 2010 I didn't understand the whole thing but I will try to answer what I did. - GOTO from batch file can be replaced with if...Then statement - You can use GUICtrlRead() to read the text from the text boxes. - See GuiCreateProgress() for the progress bar - You can use the variable with to hold the return reults and output to as many list boxes you want. Good Luck!!! and welcome! Link to comment Share on other sites More sharing options...
jnkbcs Posted September 15, 2010 Author Share Posted September 15, 2010 (edited) I didn't understand the whole thing but I will try to answer what I did.- GOTO from batch file can be replaced with if...Then statement- You can use GUICtrlRead() to read the text from the text boxes.- See GuiCreateProgress() for the progress bar- You can use the variable with to hold the return reults and output to as many list boxes you want. Good Luck!!! and welcome!Thanks Jat421.Let me be a little more specific so this way any help that i get will help someone else down the line.1. The text input will be used for Userid's network. Like FRED234. 2. The Search button will query the network and pull up the computers it has logged into or is logged onto now.3. The two list boxes will show the results accordingly. I know this is allot i am tackling.4. When you click on one of the computer names it gets brought up to the computer name text box5. Now i have some fun. I can either click the Shadow Button ( I know its remoting in but this comp calles it shadowing) by the variable in the computer name text box6. The next two tabs will use the computer name box as well to do various stuff.Whew. thats allot on the first tab i know. For now i want to break it up and learn it step by step. Currently there is one While .. Wend clause.I want to know if i take the line: $Search = GUICtrlCreateButton("Search", 72, 41, 83, 25)GUICtrlSetFont(-1, 12, 400, 0, "Berlin Sans FB")$userid = GUICtrlCreateInput("", 160, 41, 81, 23)GUICtrlSetFont(-1, 10, 400, 0, "Berlin Sans FB")Can I create another While statement or do i need to carry on in the same one that has been started? and if so how do i separate so i can jump down to that command? Like i said I am really new at this. And i hope i haven't bitten off more than i can chew. Edited September 15, 2010 by jnkbcs Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 15, 2010 Moderators Share Posted September 15, 2010 jnkbcs, Welcome to the AutoIt forum. i hope i haven't bitten off more than i can chewNo, but you might have to take slightly smaller mouthfuls to begin with! First, you need to get a basic grounding in how AutoIt works. Creating a GUI is simple - it is the code behind the pretty buttons that does the work. For example, I have just looked at one of my larger scripts - out of around 4600 lines, only about 200 create the front-end GUI. So you have a lot of work to do to fill in the "working parts" of your script Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). Once you have a grasp of how AutoIt functions, you should then see more clearly how you will need to structure your code to do what you require. The best advice I can give is to break it up into small chunks and solve each part at a time. That is when we can help you sort out any problems you might run across. I know you want to start coding your app NOW, but some study first will save you a lot of trouble later on, believe me. If you just try and cobble together something using examples plucked from the forum without understanding how they interact, you will end up with completely unmaintainable code and neither you nor any eventual successor will thank you for it later. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
jnkbcs Posted September 15, 2010 Author Share Posted September 15, 2010 jnkbcs, Welcome to the AutoIt forum. No, but you might have to take slightly smaller mouthfuls to begin with! First, you need to get a basic grounding in how AutoIt works. Creating a GUI is simple - it is the code behind the pretty buttons that does the work. For example, I have just looked at one of my larger scripts - out of around 4600 lines, only about 200 create the front-end GUI. So you have a lot of work to do to fill in the "working parts" of your script Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). Once you have a grasp of how AutoIt functions, you should then see more clearly how you will need to structure your code to do what you require. The best advice I can give is to break it up into small chunks and solve each part at a time. That is when we can help you sort out any problems you might run across. I know you want to start coding your app NOW, but some study first will save you a lot of trouble later on, believe me. If you just try and cobble together something using examples plucked from the forum without understanding how they interact, you will end up with completely unmaintainable code and neither you nor any eventual successor will thank you for it later. M23 Melba23 - Thanks for the info. That's what i needed to hear. I am working the tutorials from the documentation now. so well see how well it goes. last thing i want to do is get snippet from here and there and then i have no idea how they work. Link to comment Share on other sites More sharing options...
jnkbcs Posted September 15, 2010 Author Share Posted September 15, 2010 I didn't understand the whole thing but I will try to answer what I did.- GOTO from batch file can be replaced with if...Then statement- You can use GUICtrlRead() to read the text from the text boxes.- See GuiCreateProgress() for the progress bar- You can use the variable with to hold the return reults and output to as many list boxes you want. Good Luck!!! and welcome!Hey Jat421 - Where do i find the info on the GuiCreateProgress()? I looked in help and can not find anything on that Link to comment Share on other sites More sharing options...
whim Posted September 15, 2010 Share Posted September 15, 2010 Where do i find the info on the GuiCreateProgress()? That was a typo, try under GuiCtrlCreateProgress()HTH,whim Link to comment Share on other sites More sharing options...
Jat421 Posted September 15, 2010 Share Posted September 15, 2010 Thanks Whim ...yea the best way I learned it was by trying the examples in the help file. Good Luck! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 15, 2010 Moderators Share Posted September 15, 2010 jnkbcs,When you reply please use the "Add Reply" button at the top and bottom of the page rather then the "Reply" button in the post itself. That way you do not get the contents of the previous post quoted in your reply and the whole thread becomes easier to read. M23  Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area  Link to comment Share on other sites More sharing options...
jnkbcs Posted September 16, 2010 Author Share Posted September 16, 2010 Melba23 - Will do. Yeah i found it after doing some searching. I decidesd to take a step backward and do a little coding to see how its all working. I am trying to run an application but i need to declare two programs. I am trying to get the values for the Systernals suite going. Here is what i have so far; $prodam =" " $pass =" " $compip =" " RunAs( $prodam, 'prod-am', $pass, 2, "c:\temp\psexec", $compip "c:\program files\internet explorer\iexplore.exe") not having any luck. any ideas? Link to comment Share on other sites More sharing options...
jnkbcs Posted September 16, 2010 Author Share Posted September 16, 2010 (edited) Can it be strung this way?; Fill in the username and password appropriate for your system.Local $sUsername = "Username"Local $sPassword = "Password"Local $sCompname = "Computername"Local $sDomain = "Domainname"; Run psexec.exe from a remote machine to close out a process.Local $pid = RunWait("c:\temp\psexec -s" $sCompname "-c pskillie.cmd", "c:\"); Wait for the process to close.ProcessWaitClose($pid)This is from the help on sysinternals site:To run Internet Explorer as with limited-user privileges use this command:psexec -l -d "c:\program files\internet explorer\iexplore.exe"but i want to pass values to it and be run from remote machine.can i cut up a command like i have above? Edited September 16, 2010 by jnkbcs Link to comment Share on other sites More sharing options...
jnkbcs Posted September 17, 2010 Author Share Posted September 17, 2010 Ok i have it figured out: Local $sCompname = "" Local $sDomain = "" Local $sPsexe = "C:\temp\psexec -s \\" Local $sIEkill = " c:\temp\pskill iexplore" ; Run a command prompt as the other user. Local $iekill = RunWait($sPsexe & $sCompname & $sIEkill) ; Wait for the process to close. ProcessWaitClose($iekill) now all i need to do is add it to my main program. <cracking of nuckles> 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