Jump to content

Run .HTA at login screen


briank1986

Recommended Posts

Hello everyone!

I have an .hta file that needs to be run at the WinXP login screen. It's simply just some graphical text with our company logo to let users know to NOT touch the PC while it is being re-imaged...

I'm having some trouble trying to get this .hta to show in this environment (login screen). For test purposes, I'm using PSexec to launch the .hta file remotely (obviously, I can't do it from the target PC due to it being at a login prompt).

mshta.exe is running as a process on the target PC, but nothing is on the screen, I've tried using the -s and -i switches but had no luck...As soon as I log into the target PC, the .hta files graphic is visible on the screen...

It has to be some environment restriction, I've seen other things ran at the logon screen but never knew how to do it.

If anyone can chime in with any ideas, it will be greatly appreciated!

Thanks,

Brian.

Link to comment
Share on other sites


OK, change of plans. I decided to just make a screen saver and make a script to copy the .scr file into system32 and set the registry to use this screen saver. I also set the registry time out for 1 second that way the screen saver will appear almost right away letting the user know that it is re-imaging.

Here is the VBScript if anyone needs to do something like this...

On Error Resume Next

Dim objShell, RegLocate, WshShell

Set WshShell = WScript.CreateObject("WScript.Shell")

destdir = WshShell.ExpandEnvironmentStrings("%windir%")

Set FileSystemObject = CreateObject("Scripting.FileSystemObject")

FileSystemObject.CopyFile "<PLACE YOUR .SCR FILE NAME HERE>", destdir &"\system32\"

Set objShell = WScript.CreateObject("WScript.Shell")

RegLocate = "HKEY_USERS\.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOut"

objShell.RegWrite RegLocate,"1","REG_SZ"

RegLocate = "HKEY_USERS\.DEFAULT\Control Panel\Desktop\SCRNSAVE.EXE"

objShell.RegWrite RegLocate,"wach.scr","REG_SZ"

WScript.Quit

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
  • Recently Browsing   0 members

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