Sign in to follow this  
Followers 0
Chigin

need help for a newbie

6 posts in this topic

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

 

Share this post


Link to post
Share on other sites



Hello Chigin,

Please show us your code

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

@michaelslamet : Thanks it works!!! Thanks!!!!!

@Jos: It will still work :) just renamed the .exe to SSP ;)

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