Sign in to follow this  
Followers 0
Skizz

inputbox cancel button help

3 posts in this topic

#1 ·  Posted (edited)

Okay, I am a noob, but writing a simple script to execute an update to the .net framework on remote computers on the network, my problem is that I don't want the notepad to come up or the script to execute if you click the cancel button on the input box and would like an error if the hostname was not found. Any ideas?

#Include <process.au3>
#include <GUIConstants.au3> 
GUISetState()
$msg = DotNet()
Func DotNet ()
    DIM $Computer
    $Computer = Inputbox ("Type remote computername", "Computername", "")
    RUN(@ComSpec & ' /c \\$server\share\psexec.exe \\' & $Computer & ' -u $username -p $password %systemroot%\Microsoft.NET\Framework\v2.0.50727\caspol '& '-machine ' & '-chggroup 1.5. ' & 'FullTrust' & ' >> \\' & $Computer & '\c$\windows\temp\results.txt')
    Sleep(5000);five seconds
    RUN('notepad \\' & $Computer & '\c$\Windows\temp\results.txt')
EndFunc
Edited by Skizz

Share this post


Link to post
Share on other sites



maybe..

Func DotNet ()
    DIM $Computer
    $Computer = Inputbox ("Type remote computername", "Computername", "")
If $Computer = "" then Return
; continue function

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Nice! Thank you!

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