Sign in to follow this  
Followers 0
akRJ

please tell me there is a better way to do this

6 posts in this topic

Hey guys, I have a GUI that has a lot of buttons, all of the buttons launch a vnc window to the target computer on the button. this is the code i wrote because i'm awful with arrays, i imagine there is a much easier way to do this

thanks!

Case $BtnD[1]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop1 /password "&$pass)
        Case $BtnD[2]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop2 /password "&$pass)
        Case $BtnD[3]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop3 /password "&$pass)
        Case $BtnD[4]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop4 /password "&$pass)
        Case $BtnD[5]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop5 /password "&$pass)
        Case $BtnD[6]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop6 /password "&$pass)
        Case $BtnD[7]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop7 /password "&$pass)
        Case $BtnD[8]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop8 /password "&$pass)
        Case $BtnD[9]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop9 /password "&$pass)
        Case $BtnD[10]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop10 /password "&$pass)
        Case $BtnD[11]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop11 /password "&$pass)
        Case $BtnD[12]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop12 /password "&$pass)
        Case $BtnD[13]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop13 /password "&$pass)
        Case $BtnD[14]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop14 /password "&$pass)
        Case $BtnD[15]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop15 /password "&$pass)
        Case $BtnD[16]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop16 /password "&$pass)
        Case $BtnD[17]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop17 /password "&$pass)
        Case $BtnD[18]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop18 /password "&$pass)
        Case $BtnD[19]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop19 /password "&$pass)
        Case $BtnD[20]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop20 /password "&$pass)
        Case $BtnD[21]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop21 /password "&$pass)

Share this post


Link to post
Share on other sites



It's hard to tell without seeing how the other controls are handled... but assume your using $msg = GUIGetMsg() then you could use something like this...

For $i = 1 to 21
    If $msg = $BtnD[$i] Then
        Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop" & $i & " /password "&$pass)
                exitloop
    EndIf
Next

Share this post


Link to post
Share on other sites

It's hard to tell without seeing how the other controls are handled... but assume your using $msg = GUIGetMsg() then you could use something like this...

For $i = 1 to 21
    If $msg = $BtnD[$i] Then
        Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop" & $i & " /password "&$pass)
                exitloop
    EndIf
NextoÝ÷ Ûú®¢×z·¢²Ø^Â%yÊzǶ*'­è­Ø§Ø^nëm¢{"ßÙe¶¼­«bjkyȵëaz¥¥«­¢+Ù]¡¥±Ä(ÀÌØí¹5ÍôU%Ñ5Í ¤(MÝ¥Ñ ÀÌØí¹5Í(
ÍÀÌØíU%}Y9Q}
1=M(á¥Ð(
ÍÀÌØíѹ}½¹¹Ð(ÍÑ}½¹¹Ð ¤(
ÍÀÌØíѹ}Ý­(M¡±±áÕÑ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíÝ­±°¹ÐÅÕ½Ðì¤(
ÍÀÌØíѹ}Ù¹(Ù¹}±° ¤(
ÍÀÌØíѹ}Á±½ä(Á±½ä ¤(
ÍÀÌØí  Ñ¹lÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹låt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄÀ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÄåt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÄä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈÀ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÈåt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÈä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌÀ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÌåt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÌä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐÀ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÐåt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáͭѽÀÐä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹lÔÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥ÝȹáÁÐÄȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1låt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄÀ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÙt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄؽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄÝt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄܽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄát(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄà½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÄåt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÄä½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÈÁt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÈÀ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÈÅt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÈĽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÈÉt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÈȽÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÈÍt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÈ̽ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÈÑt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÈнÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍ̤(
ÍÀÌØí  Ñ¹1lÈÕt(IÕ¸ ÅÕ½ÐìÀäÈìÀäÈìÅÕ½ÐìµÀìÀÌØí±½¥¹MÉÙȵÀìÅÕ½ÐìÀäÈíQµÀÀäÈíÁÐÀäÈíٹ٥Ýȹá±ÁѽÀÈÔ½ÁÍÍݽÉÅÕ½ÐìµÀìÀÌØíÁÍÌ

Share this post


Link to post
Share on other sites

its really cumbersome I know

Share this post


Link to post
Share on other sites

Wouldn't it be better to use a drop down and just a go button?

Share this post


Link to post
Share on other sites

yeah, but it would sort of defeat the point, i guess now its hard to see what i'm doing without the whole code, here it is:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.0.0
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Dim $i = 1
Dim $response, $reponse
Dim $label

Global $BtnD[51], $BtnL[26], $left = 40, $top = 8, $Cnt = 0, $a, $b

$loginServer = InputBox("PDC","Please enter the login server for this site","server01")
$pass = InputBox("VNC password", "Enter the vnc password for this location", "******")

FileWriteLine("Login_server.txt",$loginServer)
DirCreate("\\"&$loginServer&"\temp\dpt\maintenance\"&@MON&"-"&@MDAY&"-"&@YEAR)
$Form1 = GUICreate("Maintenance Console ", 882, 701, 193, 115)
$Group1 = GUICtrlCreateGroup("PCs", 192, 8, 689, 649)

For $ii = 1 To 3
    $top = 8
    $left += 160
    For $x = 1 To 25
        $top += 24
        If $ii >= 3 Then
           
           $BtnL[$x] = GUICtrlCreateButton("Laptop " & $x, $left, $top, 89, 17, 0)
        Else
            
            If $ii >= 2 Then $Cnt = 25
            $BtnD[$x + $Cnt] = GUICtrlCreateButton("Desktop " & $x + $Cnt, $left, $top, 89, 17, 0)
        EndIf
    Next
Next

$btn_wake = GUICtrlCreateButton("Wake all PCs", 0, 136, 185, 65, 0)
$btn_connect = GUICtrlCreateButton("Establish Connection", 0, 232, 185, 65, 0)
$btn_deploy = GUICtrlCreateButton("Deploy Client", 0, 424, 185, 65, 0)
$btn_vnc = GUICtrlCreateButton("VNC all PCs", 0, 328, 185, 65, 0)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btn_connect
            est_connect()
        Case $btn_wake
            ShellExecute("\\"&$loginServer&"\Temp\dpt\wakeall.bat")
        Case $btn_vnc
            vnc_all()
        Case $btn_deploy
            deploy() 
        Case $BtnD[1]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop1 /password "&$pass)
        Case $BtnD[2]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop2 /password "&$pass)
        Case $BtnD[3]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop3 /password "&$pass)
        Case $BtnD[4]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop4 /password "&$pass)
        Case $BtnD[5]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop5 /password "&$pass)
        Case $BtnD[6]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop6 /password "&$pass)
        Case $BtnD[7]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop7 /password "&$pass)
        Case $BtnD[8]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop8 /password "&$pass)
        Case $BtnD[9]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop9 /password "&$pass)
        Case $BtnD[10]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop10 /password "&$pass)
        Case $BtnD[11]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop11 /password "&$pass)
        Case $BtnD[12]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop12 /password "&$pass)
        Case $BtnD[13]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop13 /password "&$pass)
        Case $BtnD[14]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop14 /password "&$pass)
        Case $BtnD[15]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop15 /password "&$pass)
        Case $BtnD[16]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop16 /password "&$pass)
        Case $BtnD[17]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop17 /password "&$pass)
        Case $BtnD[18]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop18 /password "&$pass)
        Case $BtnD[19]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop19 /password "&$pass)
        Case $BtnD[20]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop20 /password "&$pass)
        Case $BtnD[21]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop21 /password "&$pass)
        Case $BtnD[22]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop22 /password "&$pass)
        Case $BtnD[23]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop23 /password "&$pass)
        Case $BtnD[24]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop24 /password "&$pass)
        Case $BtnD[25]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop25 /password "&$pass)
        Case $BtnD[26]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop26 /password "&$pass)
        Case $BtnD[27]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop27 /password "&$pass)
        Case $BtnD[28]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop28 /password "&$pass)
        Case $BtnD[29]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop29 /password "&$pass)
        Case $BtnD[30]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop30 /password "&$pass)
        Case $BtnD[31]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop31 /password "&$pass)
        Case $BtnD[32]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop32 /password "&$pass)
        Case $BtnD[33]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop33 /password "&$pass)
        Case $BtnD[34]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop34 /password "&$pass)
        Case $BtnD[35]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop35 /password "&$pass)
        Case $BtnD[36]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop36 /password "&$pass)
        Case $BtnD[37]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop37 /password "&$pass)
        Case $BtnD[38]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop38 /password "&$pass)
        Case $BtnD[39]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop39 /password "&$pass)
        Case $BtnD[40]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop40 /password "&$pass)
        Case $BtnD[41]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop41 /password "&$pass)
        Case $BtnD[42]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop42 /password "&$pass)
        Case $BtnD[43]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop43 /password "&$pass)
        Case $BtnD[44]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop44 /password "&$pass)
        Case $BtnD[45]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop45 /password "&$pass)
        Case $BtnD[46]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop46 /password "&$pass)
        Case $BtnD[47]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop47 /password "&$pass)
        Case $BtnD[48]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop48 /password "&$pass)
        Case $BtnD[49]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop49 /password "&$pass)
        Case $BtnD[50]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe desktop50 /password "&$pass)
        Case $BtnL[1]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop1 /password "&$pass)
        Case $BtnL[2]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop2 /password "&$pass)
        Case $BtnL[3]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop3 /password "&$pass)
        Case $BtnL[4]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop4 /password "&$pass)
        Case $BtnL[5]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop5 /password "&$pass)
        Case $BtnL[6]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop6 /password "&$pass)
        Case $BtnL[7]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop7 /password "&$pass)
        Case $BtnL[8]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop8 /password "&$pass)
        Case $BtnL[9]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop9 /password "&$pass)
        Case $BtnL[10]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop10 /password "&$pass)
        Case $BtnL[11]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop11 /password "&$pass)
        Case $BtnL[12]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop12 /password "&$pass)
        Case $BtnL[13]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop13 /password "&$pass)
        Case $BtnL[14]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop14 /password "&$pass)
        Case $BtnL[15]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop15 /password "&$pass)
        Case $BtnL[16]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop16 /password "&$pass)
        Case $BtnL[17]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop17 /password "&$pass)
        Case $BtnL[18]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop18 /password "&$pass)
        Case $BtnL[19]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop19 /password "&$pass)
        Case $BtnL[20]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop20 /password "&$pass)
        Case $BtnL[21]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop21 /password "&$pass)
        Case $BtnL[22]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop22 /password "&$pass)
        Case $BtnL[23]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop23 /password "&$pass)
        Case $BtnL[24]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop24 /password "&$pass)
        Case $BtnL[25]
            Run("\\"&$loginServer&"\Temp\dpt\vncviewer.exe laptop25 /password "&$pass)
    
    EndSwitch
    
WEnd

Func est_connect()
    $i = 1
    Do
        $reponse = Ping("desktop"&$i, 1000)
   
        ;MsgBox(1,"",$reponse&" "&@error)
        If $reponse >= 1 Then
   
            GUICtrlSetBkColor($BtnD[$i], 0x00FF00)
        ElseIf @error = 1 Then
            GUICtrlSetBkColor($BtnD[$i], 0xFF0000)
        ElseIf @error = 3 Then
            GUICtrlSetBkColor($BtnD[$i], 0xFFFF00)
        ElseIf $reponse = 0 AND @error = 4 Then
            GUICtrlSetBkColor($BtnD[$i], 0xFFFF00)
        ;Else
            ;MsgBox(4096, "Error", $reponse)
        EndIf
        $i = $i + 1
    Until $i = 51
    
        $i = 1
    Do
        $reponse = Ping("laptop"&$i, 1000)
   
        ;MsgBox(1,"",$reponse&" "&@error)
        If $reponse >= 1 Then
      
            GUICtrlSetBkColor($BtnL[$i], 0x00FF00)
        ElseIf @error = 1 Then
            GUICtrlSetBkColor($BtnL[$i], 0xFF0000)
        ElseIf @error = 3 Then
            GUICtrlSetBkColor($BtnL[$i], 0xFFFF00)
        ElseIf $reponse = 0 AND @error = 4 Then
            GUICtrlSetBkColor($BtnL[$i], 0xFFFF00)
        ;Else
            ;MsgBox(4096, "Error", $reponse)
        EndIf
        $i = $i + 1
    Until $i = 26
    
EndFunc   ;==>est_connect

Func vnc_all()
        
    $ip = @IPAddress1
    $ip = StringLeft($ip, 11)
    Run(@ComSpec & " /c" & "\\"&$loginServer&"\Temp\dpt\vncall.bat"&" "&$ip&" "&$pass)

EndFunc

Func deploy()
    $i = 1
    Do
        FileCopy("\\"&$loginServer&"\temp\dpt\maintenance\Login_server.txt","C:\dpt", 1)
        FileCopy("\\"&$loginServer&"\temp\dpt\maintenance\maintenance_client.exe","\\desktop"&$i&"\c$\Documents and Settings\All Users\Start Menu\Programs\Startup", 1)
        $i = $i + 1
    Until $i = 51

    $i = 1
    Do
        FileCopy("Login_server.txt","\\laptop"&$i&"\c$\dpt", 1)
        FileCopy("maintenance_client.exe","\\laptop"&$i&"\c$\Documents and Settings\All Users\Start Menu\Programs\Startup", 1)
        $i = $i + 1
    
    Until $i = 26

EndFunc

it shows you what computers are online after hiting the establish connection button, and then from there you can click the computer to VNC it

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