Jump to content

login script calling an autoit exe


Recommended Posts

Hello,

I created an exe file from a simple autoit script and it's working correctly when I launch it manually. But it works only partially when executed by the login script :

After the login, logon.bat launches blockInput64.exe

In Blockinput64.exe I have the following code :

#RequireAdmin

LockComputer()

Func LockComputer()

    ; Disable user input from the mouse and keyboard.
    BlockInput(1)

    ; Displays message
    SplashTextOn ( "Attention", "Veuillez patienter pendant la mise à jour", 400, 100)

    ; Run LogonActions
    ShellExecuteWait("\\SERVER\NETLOGON\logonActions.bat")

    ; Enable user input from the mouse and keyboard.
    BlockInput(0)

EndFunc

The splash is displayed, logonActions.bat is executed but input is not blocked.

When I manually launch Blockinput64.exe from any computer, it works fine (displays message, runs logonActions.bat and blocks input).

The EXE is executed automatically and completly only on my computer (that's where autoit is installed)

Is there an explanation of such a behaviour ?

Thanks in advance

Link to comment
Share on other sites

#requireAdmin is already in the exe file.

should I mention it in the vbs file ? if yes what is the syntax in vbs ? Here is the vbs code :

'===============================================================

Const HKEY_LOCAL_MACHINE = &H80000002
'Lines to get the computer Name

Set wshShell = WScript.CreateObject( "WScript.Shell" )
strComputerName = wshShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )

Sub Run(ByVal sFile)
Dim shell

Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub

'===============================================================
'To check whether the OS is 32 bit or 64 bit of Windows 7
'===============================================================

'Lines to detect whether the OS is 32 bit or 64 bit of Windows 7

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputerName & "\root\default:StdRegProv")

strKeyPath = "HARDWARE\DESCRIPTION\System\CentralProcessor\0"

strValueName = "Identifier"

oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
'===============================================================

'Checking Condition whether the build is 64bit or 32 bit

if (instr(strValue,"64")) then

Run "\\domain.local\netlogon\BlockInput64.exe"

End If

if (instr(strValue,"x86")) then

Run "\\domain.local\netlogon\BlockInput32.exe"

End If
Link to comment
Share on other sites

Yes, if the vbs file runs Blockinput64.exe, regardless of whether Blockinput64.exe has it.

You might even be able to remove it from Blockinput64.exe, as I think it is just the parent process that requires it.

Sorry, I don't know vbs.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Is there anyway that I can get the vbs script back from the exe I created through AutoIT? 

 

If you used Fileinstall() you can get your vbs from install directory. But on the topic of retriving the au3 I recommend reading theese.

http://www.autoitscript.com/forum/index.php?app=forums&module=extras&section=boardrules

For future reference: 

http://www.autoitscript.com/wiki/FAQ#How_can_I_decompile_my_AutoIt_EXEs.3F

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...