Sign in to follow this  
Followers 0
TXTechie

Does AutoIt have a workaround/solution for dealing with Win7's "Interactive Services Detection" feature?

17 posts in this topic

Hello Everyone,

Does anyone know whether or not AutoIt (a built-in function or a UDF) has a workaround or solution for dealing with Windows 7's Interactive Services Detection feature?

For non-silent deployment packages (those that show some level of User Interface - UI) on Windows 7 (or Vista) how do you display a dialog box, progress bar, message, etc. to the user (Session 1) when deploying a software package that is being deployed by a software deployment solution that utilizes the Local System (SYSTEM) account (Session 0)?

Regards,

TX Techie

Share this post


Link to post
Share on other sites



 

Does anyone know whether or not AutoIt (a built-in function or a UDF) has a workaround or solution for dealing with Windows 7's Interactive Services Detection feature?

 

if you mean "how to avoid or acknowledge the ISD notification?" then no. AutoIt can not do it, and neither can any other program. it is also a very bad idea, because if someone can do it, then security threats can do it too.

how to override it? that's a different story, it requires a tailor-made solution for the package you are trying to deploy. but basically, mass deployment should be used for silent packages. interactive packages should be installed individually. for example, you can follow the AutoIt tutorial on installing WinZip, create a script for your package, and make it launch in session 1, running as a user with admin rights.

 

 

For non-silent deployment packages (those that show some level of User Interface - UI) on Windows 7 (or Vista) how do you display a dialog box, progress bar, message, etc. to the user (Session 1) when deploying a software package that is being deployed by a software deployment solution that utilizes the Local System (SYSTEM) account (Session 0)?

 

that is the default behavior. if it does not happen, even when the ISD service startup mode is "Automatic", then you have a system issue that will probably not be solved by AutoIt.

Share this post


Link to post
Share on other sites

Let me try to clarify what I want to do. Yes, most of our software deployments are completely silent to the user, but sometimes we want to let the user know something before beginning the installation or at the end of the installation.

For instance, when installing one ore more Office-related applications, we display a dialog box instructing the user to close all Office applications so that the installation is successful and doesn't error out because one or more of the Office applications are running. Another example is to display a dialog box instructing the user to save all open files and then to close all open applications because the software package will automatically force a reboot of the PC at the end (as it is required) - this is only true for a few critical software deployments.

Of course, this wasn't a problem with Windows XP, but starting with Windows Vista the Interactive Services Detection feature will not allow us to do this - at least not with any amount of certainty that the user will actually see the dialog box of instructions, since the user may never see the button flashing on the taskbar. So, I was hoping that AutoIt (either natively or via the UDF's from the community) has provided a way to display a dialog box (or something similar) to the user (Session 1) while the main script is running as Local System (Session 0). Allowing the same functionality as WinXP and previous versions of Windows, without "breaking" the Interactive Services Detection feature. That's why I called it more of a workaround.

Am I making sense?

 

Share this post


Link to post
Share on other sites

I would recommend you implement a different way to run your programs without having to work around the security feature of Session 0 Isolation. You can read these two and see if you can come up with a way to do it with AutoIT.

http://stackoverflow.com/questions/2464182/windows-2008-renderfarm-service-createprocessasuser-session-0-isolation-and-o

http://stackoverflow.com/questions/5540155/bypassing-session-0-isolation-in-windows-server-2008-successful-but-still-no

Share this post


Link to post
Share on other sites

you have 2 options:

1) formally:

users do not care about your installations, they don't want to know, and you should not force their attention (that's a sure way to get nagged by users with idiotic questions).

so what to do? simple: force the deployment overnight, and enforce a policy (either technical or formal) that everyone must log-off at end of day. if someone does not and they lose their work, that's their problem. i don't want to be brute, but that's how it is, and eventually this is for their own good. in addition, that way your package is free to reboot the pc if needed.

if you want to be on the safe side, send an email at noon to everyone, inform them there is a major installation scheduled for tonight, and they better log-off if they value their work.

2) technically:

have an agent running in the user session 1. that agent can be informed by the deployment tool (by flag monitoring, if all else fails), and that agent is able to interact with the user. you can even use the built-in Messenger service for that, although very not elegant (not to be confused with any internet-based Microsoft Messenger service for instant messaging or the Windows Messenger and Windows Live Messenger).

in my workplace both methods are implemented, but only one of them is actually used - you can guess which... ;)

Share this post


Link to post
Share on other sites

If you would like to send a message to all users on the local system during an installation, have a look at MSG.exe.  Here is an example.

RunWait('msg.exe * /TIME:60 /V /W "This computer, %COMPUTERNAME%, is going to log off. Please save your work and then close this dialog"', @SystemDir, @SW_HIDE)
Run("logoff 1 & logoff 2 & logoff 3", @SystemDir, @SW_HIDE)

I have used this on quite a few deployments to log users off.  

 

If I need to reboot or shutdown, and inform the user with SHUTDOWN.exe.  Here is an example.

Run('shutdown -r -f -t 60 -c "This computer, %COMPUTERNAME%, is going reboot in 60 seconds. Please save your work."', @SystemDir, @SW_HIDE)
1 person likes this

Share this post


Link to post
Share on other sites

Thank you, AdamUL. The msg.exe command/tool is, indeed, a useful workaround. Also, I'm a bit ashamed that in my ~ 20 years experience of technical support and systems management roles, that I was unaware of the msg.exe command/tool, which is built-in to Windows.  :

However, I was hoping for more of an internal RunAsUser function (most preferred) or some external DLL or EXE that could be called to perform this function. This would allow for a custom message of my choosing along with the ability to receive input back from the user. Also, since this is now no longer a silent install, I would then prefer to then display a progress bar of the progress of the installation to the user - so that they would know roughly how long until the PC will be rebooted, etc. I already utilize the shutdown.exe message capability, but I'm looking for a more robust way to communicate (two-way) with the user - especially at the beginning of the deployment (as I've just described above). Thank you, again, for your suggestion.

 

orbs - In our environment, we have at least a couple of reasons why we cannot fully implement your formal suggestions... 1) most of our locations are or include manufacturing labs that work around the clock in 3 shifts, and 2) roughly 1/2 of our user community uses Laptops which they take home with them after their work hours.

Are there any chances that someone within the community (with more development knowledge and skill than I currently have) might be willing to develop (or help me to develop) a RunAsUser function using AutoIt - or some other tool?

Share this post


Link to post
Share on other sites

Did you look at RunAs?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Hi BrewManNH,

Unless I'm missing something in the AutoIt Help for the RunAs/RunAsWait functions, I don't see how these can help me as I need a generic solution for any and all software deployments that won't require me to know and have the username and password of all users in my environment. Am I missing something?

Share this post


Link to post
Share on other sites

Hi BrewManNH,

Unless I'm missing something in the AutoIt Help for the RunAs/RunAsWait functions, I don't see how these can help me as I need a generic solution for any and all software deployments that won't require me to know and have the username and password of all users in my environment. Am I missing something?

I'm missing what it is you're requesting. Without another users username and password, exactly how do you intend to run something as another user?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

BrewManNH,

Check out the link that I initially shared on the Interactive Services Detection feature. Really, I'm looking for more of a RunAsUserSession - since I want to execute something (GUI, install, etc.) in the user's session 1 rather than in the running process' session 0 (since my and most software deployment solutions use the SYSTEM account).

Edited by TXTechie

Share this post


Link to post
Share on other sites

if i understand you correctly, you want the installer to RunAs a user that have admin rights on the target, and being able to interact with session 1 because it is actually running in session 1.

you have 2 problems with that:

1) how would you launch it? a remote call can launch anything, but limited to its caller context - session 0 if it's a service, caller session otherwise, but never the locally-logged-on user session.

2) even if you overcome that, UAC will show it's ugly head and put a stick in your wheel.

i think your solution would be something along my 2nd suggestion:

have an agent running in the user session 1. that agent can be informed by the deployment tool (by flag monitoring, if all else fails), and that agent is able to interact with the user.

Share this post


Link to post
Share on other sites

Hi orbs,

You may be correct, and I'm not enough of a developer to come up with a solution for your 2nd suggestion (another agent).

In talking with someone else within the Systems Management discipline at another company, he says he has no problem using AutoIt or other deployment mechanisms that do display dialog boxes to interact with users on Win7 using SCCM and he thinks Altiris. So, what I may need to do is contact my software deployment product company (CA) to see if they have a solution for the  Interactive Services Detection feature.

I want to thank everyone for their input and feedback!

Share this post


Link to post
Share on other sites

yes, Altiris is using an agent running in the user context. that agent is far more powerful than just user interaction, it also collects workstation status info, and allows authorized users to manually launch backup/restore/deployment operations from their session.

naturally, a vendor-supported agent is best, but it is also very not complicated to write such an agent with AutoIt.

Share this post


Link to post
Share on other sites

TxTechie,

You may have to FileInstall a seperately compiled script but you should be able to create a process on the default windows station which is user interactive. I don't know about the security/detection thats being mentioned but procesess inherit privileges from their parent process and the Window StationDesktop their created on unless you use WinAPI_CreateProcess to specify the desktop to be used during process creation. What I'm getting at is that you should be able to spawn a child process on the default desktop("Winsta0default") even if your service is running on a non-interactive window station like most services do. I'll post example usage later on just incase you'd like to put the theory to the test.

Anonymous

1 person likes this

Spoiler

censored.jpg

 

Share this post


Link to post
Share on other sites

Hi Decipher,

I would greatly appreciate any insight you have. Based on several years (and versions) of working with CA and their solution, I don't have much confidence that they will provide me with a solution to this issue. So, I would certainly be interested in being able to control this on my own, apart from the CA agents.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Try running this from your service:

#Include <APIConstants.au3>
#Include <WinAPIEx.au3>

Dim $hPrevStation = _WinAPI_GetProcessWindowStation()
Dim $hStation = _WinAPI_OpenWindowStation("WinSta0",  $WINSTA_ALL_ACCESS)
If _WinAPI_SetProcessWindowStation($hStation) Then
    ConsoleWrite("Current Window Station is WinSta0!" & @CRLF)
EndIf
Dim $pText = _WinAPI_CreateString('default')
Dim $tProcess = DllStructCreate($tagPROCESS_INFORMATION)
Dim $tStartup = DllStructCreate($tagSTARTUPINFO)
DllStructSetData($tStartup, 'Size', DllStructGetSize($tStartup))
DllStructSetData($tStartup, 'Desktop', $pText)
If _WinAPI_CreateProcess('', @SystemDir & '\calc.exe', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, DllStructGetPtr($tStartup), DllStructGetPtr($tProcess)) Then
    ProcessWaitClose(DllStructGetData($tProcess, 'ProcessID'))
EndIf
_WinAPI_FreeMemory($pText)
If _WinAPI_SetProcessWindowStation($hPrevStation) Then
    ConsoleWrite("Original Window Station restored!" & @CRLF)
EndIf

The process should show its GUI.

Anonymous

Edited by Decipher

Spoiler

censored.jpg

 

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

  • Similar Content

    • AutoitMike
      By AutoitMike
      I saw a post dated 2013 about WinSetTitle not working in Win7 64bit. No answer there for me.
      I am trying to set the title of a window, the function returns success and the title is changed for about 50 ms and then reverts back to its original value.
      #RequireAdmin makes no difference in operation.
      I have tried using the handle, the title and the class to define the window. Operation is the same for all three ways.
      EG:
      WinSetTitle("Old Title", "", "New Title")
      WinSetTitle("[Class:Class name]","","New Title")
      WinSetTitle(handle,"","New Title")
      ;=======================================================================================
      All functions report success.
      WinActivate("PxxCXpbHG", "Text")
      WinSetTitle("PxxCXpbHG ", "Text","New title")
      $M1=WinGetTitle("[ACTIVE]","")
      sleep (100)
      $M2=WinGetTitle("[ACTIVE]","")
      MsgBox(0,"", $M1 & "  " & $M2) ;------------------> "New Title"  "PxxCXpbHG"
      If I change Sleep to 50 , then it is "New Title", "New Title" so somewhere between 50 and 100 ms it gets changed back,but by what??
      Thanks for any help in this matter.
       
       
       
       
    • imitto
      By imitto
      Hello all!
      I was in read-only until today, started to use Autoit 3 weeks ago. It can really make things easy, I really love it
      I have some script now that works and make our job effective, but I have problems with the latest. It works if I open the script's folder and run the exe directly. If I use the shortcut that I created on the desktop, it's not working properly. Activates the window, but not opening/exporting my files, just opens the last msgbox. I use ftp becouse the PC and the destination PC is not on the same network.
      Here's the script:
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\microsoft_excel.ico #AutoIt3Wrapper_Res_Comment=send file over ftp #AutoIt3Wrapper_Res_Description=send file over ftp for process #AutoIt3Wrapper_Res_Language=1038 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: imitto Script Function: Rename and put playlist file on ftp #ce ---------------------------------------------------------------------------- #RequireAdmin #include <File.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> #include <FTPEx.au3> ; Script Start Global $playlistname=@YEAR&@MON&@MDAY&"-playlist.pll" BlockInput($BI_DISABLE) Opt ("WinTitleMatchMode", 2) WinActivate("MAIN SCHED") WinWaitActive("MAIN SCHED") ;Opt ("WinTitleMatchMode", 1) Send("!fo") WinWaitActive("Open") Send("Z:\playlist\"&$playlistname&"{ENTER}") Sleep(2000) Send("!fe") WinWaitActive("MCon") Send("{ENTER}") WinWaitActive("Save") Send("C:\sendFileForXLS\lista.txt{ENTER}") Sleep(500) Send("!fc") BlockInput($BI_ENABLE) Sleep(50) Opt ("WinTitleMatchMode", 1) Local $hOpen = _FTP_Open('MyFTP Control') $ftp=_FTP_Connect($hOpen, "**********", "******", "******") If @error Then MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR=' & @error) Else _FTP_FilePut($ftp, @ScriptDir&"\lista.txt", "/lista.txt") EndIf Local $iFtpc = _FTP_Close($hOpen) FileDelete(@ScriptDir&"\lista.txt") MsgBox(0, "", "Playlist exported", 2) Exit  
    • meows
      By meows
      no web server atm. so the win7 file properties images I can't show you but they are totally different from the variables I am getting..But then I am just guesstamating the code needed from any and all sources i can find to just get the Minutes difference between 2 files.
      I can touch the files to change anything, but can't get the value to use it and using FilesetTime/ only works with the Help code. and it is way over my head. I have searched the web looking for a step by step but it's all in arrays that array me.
      The FileSetTime
      ;Modified help file #include <FileConstants.au3> #include <MsgBoxConstants.au3> $sFilePath=("C:\file1.txt") Local $iFileSetTime = FileSetTime($sFilePath, "20031101121101"  )     ; Display the modified timestamp of the file and return as a string in the format YYYYMMDDHHMMSS.     If $iFileSetTime Then        ; MsgBox($MB_SYSTEMMODAL, "", "Timestamp:" & @CRLF & FileGetTime($sFilePath, $FT_ACCESSED, 2  ))  RETURNS Timestamp:     ;   MsgBox($MB_SYSTEMMODAL, "", "Timestamp:" & @CRLF & FileGetTime($sFilePath, 2  ))                  RETURNS Timestamp:       ; MsgBox($MB_SYSTEMMODAL, "", "Timestamp:" & @CRLF & FileGetTime($sFilePath, "YYYYMMDDHHMMSS"  ))  RETURNS Timestamp:       ; MsgBox($MB_SYSTEMMODAL, "", "Timestamp:" & @CRLF & FileGetTime($sFilePath, $FT_MODIFIED, 1))       RETURNS Timestamp:       The only one that returns Anything is the last one and it returns the whole string..Timestamp:20031101121101  ; RETURNS  Timestamp:20031101121101      File Properties accessed time and date ?Saturday, ?November ?01, ?2003, ??1:01:00 AM File EndIf changed created date but displays YYYYMMDDHHMMSS"
      So I got creative and after /////..... and more of that got this to work.. "Kinda"
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile=TimeCK.exe #AutoIt3Wrapper_Res_Fileversion=21 #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #AutoIt3Wrapper_Add_Constants=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include<File.au3> #include <FileConstants.au3> #include <Constants.au3> #include <MsgBoxConstants.au3> #Include <Date.au3> ;change file.au3's "modified" timestamp to 1st Nov 2003 and current time ;Local $var = FileSetTime("file.au3", "20031101") ;Local $iFileSetTime = FileSetTime($sFilePath, "20031101", $FT_MODIFIED) ;Local $iFileSetTime = FileSetTime("c:\2a.jpg", "20031101", 1) ;change file.au3's "modified" timestamp to 1st Nov 2003 and current time ;Local $v = FileSetTime(@ScriptDir &"\00\2a.jpg", "20031101", 1) Local $v = FileSetTime(@ScriptDir &"\00\2a.jpg", "2003110120031101121101", 1) If Not @error Then    ; Local $HHMMSS =  $v[0] & "/" &  $v[1] & "/" &  $v[2]      Local $MMss =  ($v )     MsgBox(0, "Creation date of 2a", $MMss) EndIf Local $t = FileGetTime(@ScriptDir & "\00\Files\core\2a.jpg", 1) ;HH:MM:SS If Not @error Then ;      Local $hhmms = $t[0] & "/" & $t[1] & "/" & $t[2]     Local $mm = $t[1]     MsgBox(0, "time change", $mm) ;Local $t = FileGetTime("c:\2a.jpg", 1) ;HH:MM:SS ;If Not @error Then ;      Local $hhmms = $t[0] & "/" & $t[1] & "/" & $t[2]  ;   Local $mm = $t[2]   ;  MsgBox(0, "Creation date of notepad.exe", $mm) EndIf The issue is it gives 3 totally different times for the Minute.. I only want the minute difference.
      the "Creation date of 2a" tag gives a 0 minute value==and in 3 hours now it still gives the 0 minute value
      the "time change" tag gives a 28 minute value ==== and in 3 hours now it still gives the 28 minute value
      Win7 "File Properties" tag gives
      ?Sunday, ?June ?22, ?2014, ??1:11:42 PM   ------------FileSetTime(@ScriptDir &"002a.jpg", "2003110120031101121101", 1)
      Saturday, ?June ?28, ?2014, ??3:05:36 PM
      Sunday, ?June ?22, ?2014, ??1:11:42 PM



      Saturday, ?November ?01, ?2003, ??7:03:11 PM --------------------FileGetTime(@ScriptDir & "00Filescore2a.jpg", 1)
      Saturday, ?June ?28, ?2014, ??3:05:36 PM
      ?Today, ?June ?30, ?2014, ??5 minutes ago   
       
      U know I think I learned more in the two hours it took to write this very bad dissertation of the issue. Researching everything I wanted to say and try to explain the steps took to get the results.
    • Kovacic
      By Kovacic
      Simple script that took me about 15 minutes. I built it for a friend but thought someone else could use it..
      Just make sure you compile it as 64bit if you have a 64bit system which most of you using windows 7 do.
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=HWandHank.ico #AutoIt3Wrapper_UseUpx=n #AutoIt3Wrapper_UseX64=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.10.2 Author: Mike Kovacic Script Function: Set windows 7 to auto login using provided credentials. * This must be compiled as x64 to work. #ce ---------------------------------------------------------------------------- #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $MuhApp = GUICreate("Set Autologon", 309, 127, 212, 132) $Username = GUICtrlCreateInput("", 8, 16, 153, 21) $Password = GUICtrlCreateInput("", 8, 48, 153, 21) $Domain = GUICtrlCreateInput(@ComputerName, 8, 80, 153, 21) $Set = GUICtrlCreateButton("Set Autologon", 176, 24, 123, 25) $REmove = GUICtrlCreateButton("Remove Autologin", 176, 56, 123, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $set setautoadminlogin() Case $remove removeautologin() EndSwitch WEnd Func setautoadminlogin() $a = 0 If RegWrite("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa", "LmCompatabilityLevel", "REG_DWORD", "2") then $a += 1 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") then $a += 1 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon", "REG_SZ", "1") then $a += 1 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", guictrlread($username)) then $a += 1 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword", "REG_SZ", guictrlread($Password)) then $a += 1 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName", "REG_SZ", guictrlread($Domain)) then $a += 1 If $a = 6 then MsgBox(64,"Success!","Autologon has been set.") else MsgBox(16,"Oops!","Autologon could not be set. Make sure you are a local Admin.") endif EndFunc ;==>setautoadminlogin Func removeautologin() $b = 0 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "0") then $b += 1 If RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "ForceAutoLogon", "REG_SZ", "0") then $b += 1 If RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName") then $b += 1 If RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultPassword") then $b += 1 If RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultDomainName") then $b += 1 If RegDelete("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa", "LmCompatabilityLevel") then $b += 1 If $b = 6 then MsgBox(64,"Success!","Autologon has been removed.") else MsgBox(16,"Oops!","Autologon could not be removed. Either Autologin was not set or you are not a local Admin.") endif EndFunc ;==>removeautologin Enjoy.
    • DatMCEyeBall
      By DatMCEyeBall
      I'm trying to make a "sheet of glass" with shadow text drawn on it, the problem is that the shadow isn't transparent at all. I have absolutely no idea what I am doing wrong -  being a noob with the WinAPI stuff.   Screen-shot:   Here's the script: ; Requires AutoIT beta 3.3.9.21 or newer #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Version=Beta #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <Misc.au3> #include <WinAPIGdi.au3> If Not _WinAPI_DwmIsCompositionEnabled() Then MsgBox(BitOR(16, 4096), 'Error', 'Script requires Windows Vista or later with enabled Aero theme.') Exit EndIf Global Const $STM_SETIMAGE = 0x0172 Global Const $STM_GETIMAGE = 0x0173 Global $hDarkBK = GUICreate("Dark background", 400, 40, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE)) GUISetBkColor(0) GUISetState(@SW_SHOW) Global $hGUI = GUICreate("DWM Test", 300, 20, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_WINDOWEDGE, $WS_EX_TOPMOST)) GUISetBkColor(0) _WinAPI_DwmExtendFrameIntoClientArea($hGUI) Global $Pic = GUICtrlCreatePic('', 0, 0, 300, 20) Global $hPic = GUICtrlGetHandle($Pic) Global $tRECT = _WinAPI_GetClientRect($hPic) Global $Width = DllStructGetData($tRECT, 3) - DllStructGetData($tRECT, 1) Global $Height = DllStructGetData($tRECT, 4) - DllStructGetData($tRECT, 2) Global $hDC = _WinAPI_GetDC($hPic) Global $hDestDC = _WinAPI_CreateCompatibleDC($hDC) Global $hBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $Width, $Height) Global $hDestSv = _WinAPI_SelectObject($hDestDC, $hBitmap) Global $hSrcDC = _WinAPI_CreateCompatibleDC($hDC) Global $hSource = _WinAPI_CreateCompatibleBitmapEx($hDC, $Width, $Height, _WinAPI_SwitchColor(_WinAPI_GetSysColor($COLOR_3DFACE))) Global $hSrcSv = _WinAPI_SelectObject($hSrcDC, $hSource) Global $hFont = _WinAPI_CreateFont(20, 0, 0, 0, $FW_NORMAL, 0, 0, 0, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $ANTIALIASED_QUALITY, $DEFAULT_PITCH, 'Arial') _WinAPI_SelectObject($hSrcDC, $hFont) _WinAPI_DrawShadowText($hSrcDC, "Why is the shadow not transparent?", 0xFFFFFF, 0x000000, 3, 3, $tRECT) _WinAPI_BitBlt($hDestDC, 0, 0, $Width, $Height, $hSrcDC, 0, 0, $MERGECOPY) _WinAPI_ReleaseDC($hPic, $hDC) _WinAPI_SelectObject($hDestDC, $hDestSv) _WinAPI_DeleteDC($hDestDC) _WinAPI_SelectObject($hSrcDC, $hSrcSv) _WinAPI_DeleteDC($hSrcDC) _WinAPI_DeleteObject($hSource) _WinAPI_DeleteObject($hFont) ; Set bitmap to control _SendMessage($hPic, $STM_SETIMAGE, 0, $hBitmap) Global $hObj = _SendMessage($hPic, $STM_GETIMAGE) If $hObj <> $hBitmap Then _WinAPI_DeleteObject($hBitmap) EndIf GUISetState(@SW_SHOW) Global $nMsg While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit WEnd