Sign in to follow this  
Followers 0
MrChris

Help with script

3 posts in this topic

#1 ·  Posted (edited)

I am trying to write a script that will collect information from a local pc and copy files it to a remote pc on a network via a UNC path such as \\remotepc\c$\ ect.. It will also need to write registry setting to the remote pc. I currently use a command line tool from systernals call psexec.exe to do this. I copy the exe and the file.reg file to the remote pc and have psexec execute a batch script that imports the reg file and process a few other command to start a service ect...

I have made my GUI for the most part but am not sure on how I am supposed to get the funtions of the buttons anf imput fields to actualy do anything. I have been reading through the help file and see most of the commands I need ( I think) but am not sure on how to get them to to tigh in with the GUI.

I also have 3 imput fields in my GUI such as HOST NAME, USERNAME, and PASSWORD to handle the authentication of the remote pc.

There also a progress meter at the bottom but as always not sure how to get it to show the over all progress of the file copy and deploy process.

Can anyone give me a hand or some Ideas?

Im not wanting someone to do the work for me just help me out. Since all I seem to be able to do is create the GUI but im sure anyone can do that.

Thanks,

MrChris

Edited by MrChris

Share this post


Link to post
Share on other sites



Here is what I have so far. I know its just the GUI.

; Script generated by GUIBuilder 9

#include <GuiConstants.au3>

GuiCreate("MyGUI", 412, 220,(@DesktopWidth-412)/2, (@DesktopHeight-220)/2)

$Group_1 = GuiCtrlCreateGroup("Download Tools", 3, 11, 148, 135)

$Button_2 = GuiCtrlCreateButton("Cmdow", 8, 33, 80, 20)

$Button_3 = GuiCtrlCreateButton("PsExec", 8, 55, 80, 20)

$Button_4 = GuiCtrlCreateButton("7zip", 8, 76, 80, 20)

$Button_5 = GuiCtrlCreateButton("Putty", 8, 98, 80, 20)

$Button_6 = GuiCtrlCreateButton("FreeSSHd", 8, 120, 80, 20)

$Label_7 = GuiCtrlCreateLabel("Host Name", 160, 29, 60, 20)

$Input_8 = GuiCtrlCreateInput("", 160, 42, 108, 20)

$Label_9 = GuiCtrlCreateLabel("Username", 159, 67, 60, 20)

$Input_10 = GuiCtrlCreateInput("", 160, 80, 108, 20)

$Label_11 = GuiCtrlCreateLabel("Password", 159, 107, 60, 20)

$Input_12 = GuiCtrlCreateInput("", 160, 120, 108, 20)

$Progress_13 = GuiCtrlCreateProgress(3, 208, 404, 18)

$Checkbox_14 = GuiCtrlCreateCheckbox("Reboot Remote PC", 11, 161, 112, 17)

$Checkbox_15 = GuiCtrlCreateCheckbox("Lock Remote PC", 11, 180, 105, 14)

$Button_16 = GuiCtrlCreateButton("Deploy SSHd", 281, 28, 110, 30)

$Group_17 = GuiCtrlCreateGroup("Status", 274, 11, 133, 129)

$Checkbox_18 = GuiCtrlCreateCheckbox("Settings Collected", 285, 95, 110, 15)

$Checkbox_19 = GuiCtrlCreateCheckbox("Deployed", 285, 115, 110, 15)

$Button_20 = GuiCtrlCreateButton("Test", 170, 150, 86, 20)

$Checkbox_21 = GuiCtrlCreateCheckbox("Authenticated", 285, 74, 110, 15)

$Group_22 = GuiCtrlCreateGroup("Credentials", 155, 11, 115, 171)

$Checkbox_23 = GuiCtrlCreateCheckbox("Done", 90, 35, 55, 14)

$Checkbox_24 = GuiCtrlCreateCheckbox("Done", 90, 58, 55, 14)

$Checkbox_25 = GuiCtrlCreateCheckbox("Done", 90, 102, 55, 14)

$Checkbox_26 = GuiCtrlCreateCheckbox("Done", 90, 80, 53, 14)

$Checkbox_27 = GuiCtrlCreateCheckbox("Done", 90, 124, 55, 14)

$Group_28 = GuiCtrlCreateGroup("Options", 5, 147, 146, 54)

GuiSetState()

While 1

$msg = GuiGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case Else

;;;

EndSelect

WEnd



            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
DoctorX   

    
        
    
             0
    
        
    

        
            
                Wayfarer
            
            

            
                

    
        
    

            
            Active Members
            
            
                

    
        
    
             0
    
        
    

                59 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #3 · 
            Posted 
            
                (edited)
            
            
            
        
    

    


            
        
            Doing something like this will get your buttons to work:

While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_2
; Put in code here for what button 2 is supposed to do
Case $msg = $Button_3
; Put in code here for what button 3 is supposed to do
EndSelect
WEnd

just keep creating Case $msg = *** for all of your buttons and stuff.

GUI looks nice by the way.

Edit: Looking at your GUI a second time, I suppose you want those checkboxes to be prequalifiers for something a button will do. If that's the case, you could handle that with some If-then (or select-case) type lines in the code, such as

If $msg = $checkbox_14 AND $Button_3 Then

Do Something

EndIF

Edited by DoctorX

-DRX

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0