Hello,

I'm looking for a method where a script runs client side before a user logs in after my script runs. What I'd like to do is have mine run, then it reboots, and before the user logs in the next time, my 2nd script runs.

Any Thoughts?

Chris.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
A quick update, I found SRVANY from the resource kit to help, but I can't get the service to interact with the desktop before login, only post-login - even though the service appears to run at boot and is setup with localsystem privledges.
Answered 02/10/2004 by: usachrisk
Purple Belt

Please log in to comment
0
Are you in an Active Directory environment where Group Policy is available as an option? It is not "exactly" what you are looking for, but I have seen people have a Group Policy assigned MSI run before logon (assigned to the machine) to do its first steps, then intentionally return a failure and reboot so that the group policy object will run again after reboot (where the script accounted for this and completed the second part of the installation successfully). A bit convoluted- but it worked.

Do you have another desktop management solution in place that may help you? I worked in an Altiris environment once and did what you are talking about using their client service (ACLIENT).
Answered 02/10/2004 by: bkelly
Red Belt

Please log in to comment
0
Hi,

Thanks for your quick reply. I thought about and crossed out GPOs (although they are available) because the application script I need to build is going to be run at different times throughout the organziation between different users, without IT stepping in. The user knows where to go (or is linked to by a manager) to install the application - any it wont be every user, either.

We also run Altiris, however, for the same reason as above, I can't use the Altiris solution. We wont be pushing the event to machines (although we do for 100s of apps), this will be purely a user based install.

But, I'm glad you braught up Altiris because now I can use it as an example. If you've ever used it to push an image to a PC and the do post-image configuration, you'll know of the big grey box that says "Please wait, configuring" that sits on top of or sometimes behind the login window -- that's what I'm looking for. I can build the form, but can't get it to run pre-login.

Thanks Again!
Chris.
Answered 02/10/2004 by: usachrisk
Purple Belt

Please log in to comment
0
I have not supported a client that uses Altiris for some time, but worked with Altiris closely long ago. As a big customer I was able to get an undocumented feature added that is exactly what you are looking for. You'll have to test it, because I got this feature added back with the release of version 4.5 This is the deal:

I requested a way to trigger scripts during the post imaging process. What we came up with were batch files that the Aclient service looks for before doing its own thing. As far as I know the feature remains undocumented:
When the service auto-starts, it looks for the existence of SCRIPT.BAT in the c:\altiris\aclient directory (I'm not certain if this is hard-coded to this location if you have installed the service files elsewhere). If it is there, it runs the batch file and waits for it to complete. When done the Aclient will establish communications with the server.

It will then look for (and if present execute, and wait for, PRECFG.BAT in the same path). Aclient will then process any events scheduled from the server side as normal.

This way you can choose to take action before or after the Altiris client communicates with the server- which was important to me at the time.

Back with Express 4.5, SCRIPT.BAT would execute before SysPrep, domain joins, etc. and was the reason there was a separate batch file (PRECFG.BAT). However, with version 5.x I believe that SCRIPT.BAT now executes after these post-imaging tasks (SIDGen/SysPrep, joining the domain).

Being that you are not trying to work this into your imaging process, you should be able to simply run your “part 1” and create/copy a SCRIPT.BAT file before rebooting. Upon reboot, SCRIPT.BAT will run prior to the user logging on. Just make sure you delete the batch file when you are done or it will execute every time the service tries to start.

Give it a shot and let us know how it goes!
Answered 02/10/2004 by: bkelly
Red Belt

Please log in to comment
0
Thanks Bob,

I tested putting SCRIPT.BAT into the ACLIENT folder and it does run the script before the ACLIENT initalizes and connects to the server. This will be great for future projects - however I don't see the GUI to the script that I was hoping to see until after the user begins their login.

Back to Google - I'll post my results :)

Chris.
Answered 02/10/2004 by: usachrisk
Purple Belt

Please log in to comment
0
IIRC, being able to interact with a desktop where no one is logged on requires that you acquire a handle to the currently displayed "Windows Station". This is somewhat more involved than just running a batch file or invoking a messagebox.
Answered 02/10/2004 by: Stevie
Yellow Belt

Please log in to comment
0
Agreed. This method of using Aclient will simply allow you to initiate actions following reboot. That would satisfy running the second part of an installation requiring administrative access- which I believe would be the most common desire for this type of functionality. As for displaying information with nobody logged on- I would tackle that as a separate requirement (one that will be pretty tough to realize).

I once used the windows background wallpaper to display information about an automated process where I did not want users logging on. I then set the default logon name to "DO NOT LOG ON" in the registry. This got the job done for me, but I have not come across anything that will allow selective information be displayed prior to logon. If you should find it, you may be able to use this Aclient to kick it off.

If you do find such a tool, please share it with the rest of us, and good luck in your search!
Answered 02/10/2004 by: bkelly
Red Belt

Please log in to comment
0
Hi Everyone,

Thanks for your replies. I've gotten handles to windows before (for various VB projects), but that didn't even cross my mind. What I ended up scripting yesterday was actually pretty close to the background idea from Bob.

We use the Novell client, so what I did was was create 4 BMPs for the different status messages that I wanted to be displayed (i.e. installing xyz, uninstalling abc, configuring app, etc). The BMPs are then used to replace the Novell default startup screen with status messages, and it doesn't even look like a login screen any more.

Second, I used SRVANY from the Windows 2000 Resource Kit to create a service that runs before login. The service calls a batch file called NEXTCMD.BAT. This batch file is created from my script each time it needs to do a task on reboot.

So what ends up happening is this:
1) User runs script (exe).
2) Script replaces Novell BMP with Status1.
3) Script creates service for NEXTCMD.BAT
4) Script creates NEXTCMD.BAT to run a second script for the 2nd task.
5) Script uninstalls a peice of software and reboots.

Now when it comes back up, the status window uses the new BMP, and then the service starts and NEXTCMD.BAT calls my 2nd script. So then the 2nd script:

1) Uninstalls another peice of software.
2) Replaces Novell BMP with Status2
3) Rewrites NEXTCMD.BAT with pointer to 3rd script action.
4) Reboots

And then this happens for steps 3 and 4. Then, after the last reboot, the NEXTCMD.BAT is deleted, and my custom service is stopped and removed.

Thanks Again Everyone!
Answered 02/11/2004 by: usachrisk
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity