Chigin Posted December 22, 2013 Share Posted December 22, 2013 Hi the last couple of day’s I’m trying to get the following work: Run("ntrights.exe +r SeBatchLogonRight –u user", "./Tool/") ; This command does work perfectly, but now the tricky part I want the ‘user’ to be added as a variable (added in a text box) Somehow it will not work. As a said, I’m a newbie …sorry Link to comment Share on other sites More sharing options...
michaelslamet Posted December 22, 2013 Share Posted December 22, 2013 Hello Chigin, Please show us your code Link to comment Share on other sites More sharing options...
Chigin Posted December 22, 2013 Author Share Posted December 22, 2013 Here it is, BTW thanks for the quick responce: While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button1 Run('SSITEPM.SSP') ;Go to prereq form Case $msg = $Button2 $Sure1 = MsgBox(4096+1, "", "Add the Users for Local security policy?") If $Sure1 == 1 Then Run("ntrights.exe +r SeServiceLogonRight -u", "./tool/") Run("ntrights.exe +r SeBatchLogonRight -u", "./Tool/") ; Run("ntrights.exe +r SeChangeNotifyPrivilege -u", "./Tool/") ; Run("ntrights.exe +r SeTcbPrivilege -u", "./Tool/") ; MsgBox(0,"","Users been added to the local security policy!") ElseIf $Sure1 == 2 Or 3 Then MsgBox(0,"","The Users were NOT added to the Local security Policy!") EndIf ;Case $msg = $Button3 ; Run('SSITTM1.SSP') ; Isntall Directory Case $msg = $Pic1 ShellExecute("http://www.blabla.com") EndSelect WEnd Link to comment Share on other sites More sharing options...
Solution michaelslamet Posted December 22, 2013 Solution Share Posted December 22, 2013 Few things I notice: 1. If you want MsgBox with "Yes" and "No" button, you should use MsgBox(4096+4), not MsgBox(4096+1) If the return value is "6" then the user is click on button "Yes", otherwise is "No" 2. Instead of using "./tool/" as a default folder, it's better to use @ScriptDir & "tool" Anyway "./tool/" seems incorrect, should be ".tool" (?) 3. Instead of Run('SSITEPM.SSP') better call it with full path, something like: Run(@ScriptDir & 'SSITEPM.SSP') 4. To use a variable: Run("ntrights.exe +r SeServiceLogonRight -u " & $uservar, @ScriptDir & "tool") Hope it helps Link to comment Share on other sites More sharing options...
Developers Jos Posted December 22, 2013 Developers Share Posted December 22, 2013 Few things I notice: 3. Instead of Run('SSITEPM.SSP') better call it with full path, something like: Run(@ScriptDir & 'SSITEPM.SSP') Run needs The full path of the program (EXE, BAT, COM, or PIF) to run. Doubt filename.SSP will work so you probably want to use ShellExecute(). Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Chigin Posted December 22, 2013 Author Share Posted December 22, 2013 @michaelslamet : Thanks it works!!! Thanks!!!!! @Jos: It will still work just renamed the .exe to SSP 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