jimicus Posted March 3, 2010 Share Posted March 3, 2010 Hi, I have an application which runs on boot prior to any user logging in. The application triggers an outside application to carry out any software updates that are queued for the PC. I don't want people to be logging in while this is going on and I want to display a useful message which explains why not. My application runs just fine on boot but it doesn't display the window. $uiWindow = GUICreate("Package Deployment", 350, 200, 50, 50, $WS_CAPTION); $myedit = GUICtrlCreateEdit("" & @CRLF, 10, 10,320,180, $ES_AUTOVSCROLL + $WS_VSCROLL, $WS_EX_TRANSPARENT ) $debugHandle = FileOpen("C:\temp\sanitycheck.txt", 1); ; we don't want people interfering with this BlockInput(1); GUISetState(@SW_SHOW); GUICtrlSetData($myedit, "Starting WPKG Software Deployment" & @CRLF, 1); FileWriteLine($debugHandle, "Running wpkg updater with param " & $CmdLine[1] ); This brings up a window just fine when a user's logged on - but it runs totally silently if it's run while the PC is at the login screen. I'm certain it's running because the debug log file referred to by $debugHandle is being written. Is there any way of making that window appear when the PC is at the login screen? Link to comment Share on other sites More sharing options...
Fire Posted March 3, 2010 Share Posted March 3, 2010 (edited) I have only one idea: Modify this reg key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon for userinit like this: "Userinit"="C:\\WINDOWS\\system32\\userinit.exe,c:\\myapps\\softwareupdate.exe" + "Shell" = "Explorer.exe,c:\\myapps\\softwareupdate.exe"" But i`m not sure is it usable. Anyway. Backup your system and then try this method. Edited March 3, 2010 by Sh3llC043r [size="5"] [/size] Link to comment Share on other sites More sharing options...
jimicus Posted March 3, 2010 Author Share Posted March 3, 2010 Found a better solution - set up a policy using gpedit:Under "Computer Configuration" "Windows Settings"Double click "Scripts(Startup/Shutdown)"Double click "Startup" in right pane.Click "Add" button and browse to your program and then click "ok" then Click "Ok" again.then just copy the registry entry created and install that on all PCs.This does run and does throw up the GUI. Now, how to prevent a user interacting with the PC while this is going on? BlockInput() seems to need to run in a loop, which is annoying because nothing else in the app does.... Link to comment Share on other sites More sharing options...
Fire Posted March 3, 2010 Share Posted March 3, 2010 Yes i understand you you want block user input on winlogon.Gpedit is more secure way right.I found another way how to prevent user logon to system when your application while running when winlogon.exe initialized.I thhink it can be done with group policy.Sorry my OS is XP SP2 (ru)Look this picture (below)Idea in this that.:When your application run you must simulate bruteforce (3 counts) for logon another accounts.After fake logon bruteforce trying gpedit will block accounts for specified time ( 15 minute):Here is You are successfully prevent logon to system.I know this is not right way but another way i didnt saw yet.Sorry for my awfull English.(not native) [size="5"] [/size] Link to comment Share on other sites More sharing options...
jimicus Posted March 4, 2010 Author Share Posted March 4, 2010 I have found a solution, which I share here in case someone else has the same problem. It's a bit of a kludge but it works. Run at login, bring up a window which fills the entire screen and is always on top, thus: GUICreate("Package Deployment", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOPMOST); This way the whole screen is totally covered, the login window can't easily be typed into and cannot be brought to the top. And because you're running before an interactive session has begun, the user can't use Ctrl-Alt-Delete to bring up task manager. Now, how to deploy the local policy to 50 client PCs when I don't have the benefit of AD..... 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