Jump to content

Recommended Posts

Posted

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

Posted

#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
Posted

Hi,

Is there anyway that I can get the vbs script back from the exe I created through AutoIT? I have lost the script and au3 file. 

 

Thanks in Advance

:)

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
×
×
  • Create New...