Link to home
Start Free TrialLog in
Avatar of nurbek
nurbek

asked on

run program before logon

Hi All,

I wrote a program, and it runs on windows 2003 server,

Sometimes systems restarts, and I want that program to be started before the logon (like MS-SQL)

When I logon to the system, I want to able to see GUI

thanks in advance

SOLUTION
Avatar of Jay_Jay70
Jay_Jay70
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nurbek
nurbek

ASKER

as a service it works

but I need to see the GUI when I login

Is it possible?

Make a better explanation. Do you want to see your program right after your login? If so, you can put it in the following registry key:

(for a given user)
hkey_current_user/software/microsoft/windows/current version/run

... OR ...

(for any user that logs on)
hkey_local_machine/software/microsoft/windows/current version/run

Just create a new String value -- which names doesnt matter -- and fulfill the value with your apps path.

But, you must know that this way you have to log in to start your app. If you want it to start automaticaly without any user logged on, you must to build a Windows Service or use srvany from Resource Kit.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nurbek

ASKER

The program is monitors and calculates user points, fires once a day

This is runs on the server, and when server restarts (system boots) you need to login and run the program again
when you restart the server it prompts to login

server runs (i.e web sites, sql server etc.. runs ) starting from system boot,

but my program doesnt :(
I added it to startup, but it runs after I do the login (this is not correct way)


I did it as a service, it is running

My problem is to see the GUI :)

hope it is clear



There is an easy, not a beutiful one, workaround. You can enable automatic logon to your server and put the shortcut to start your program in your regular startup folder (Start/Programs/Startup). To do so, you must add the registry values bellow.

First of all, open regedit and navigate to:

hkey_Local_Machine\Software\Microsoft\Windows NT\CurrentVersion\winlogon

Add those values:

1) AutoAdminLogon of type String
2) DefaultUserName of type String
3) DefaultPassword of type ... String (this is not good, but necessary to work)
4) DefaultDomain of type String too

Set (1) to 1
Set (2) to the desired user name. Example: "administrator"
Set (3) to the default user password. Example "myPass"
Set (4) to the domain or local computer name where the user resides.

Restart your server.

You can also set the screen saver timeout to 1 minute and set it to lock workstation. This way, your computer will lock it self.

Best regards.
If you choose srvany, i got this excellent link with explanation on how to do it.

http://www.iopus.com/guides/srvany.htm
are you able to put an executable to the GUI in the startup folder?

if the backbone is running as a service then this will run the interface on load
Avatar of nurbek

ASKER


I added to startup, It starts on logon, but then there 2 processes at the same time
also programs shows the events after I do the login

 
Avatar of nurbek

ASKER

Thanks for your help

thats ok  -  did you remove the service and just rely on startup?
Avatar of nurbek

ASKER

I used service :)

I cant see the GUI, hope that program is running acuurately :)
alright man

have a good one

cheers :)