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

LVL 13
nurbekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jay_Jay70Commented:
Hi nurbek,

just an idea but how about you install the program as a service

http://support.microsoft.com/kb/q137890/

same concept for 2003

Cheers!
0
nurbekAuthor Commented:
as a service it works

but I need to see the GUI when I login

Is it possible?

0
Renato Montenegro RusticiIT SpecialistCommented:
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.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Renato Montenegro RusticiIT SpecialistCommented:
For more information, a Windows Service isnt a regular win app. Its a win app that accepts Start, Stop, Pause, Continue commands from SCM (Service Control Manager) and in general doesnt have any graphical user interface. A service isnt built in the same way of a regular app. Srvany, from Windows Resource Kit, can help a regular win app to act like a Windows Service, but it doesnt do all the job. Your app running with srvany will not accept all SCM commands and can experiment some weird behavior in some cases.

Usually, people make a Windows Services -- without any user interface -- and a Console Application -- with the graphical user interface to manage the service or services.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nurbekAuthor Commented:
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



0
Renato Montenegro RusticiIT SpecialistCommented:
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.
0
Renato Montenegro RusticiIT SpecialistCommented:
If you choose srvany, i got this excellent link with explanation on how to do it.

http://www.iopus.com/guides/srvany.htm
0
Jay_Jay70Commented:
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
0
nurbekAuthor Commented:

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

 
0
nurbekAuthor Commented:
Thanks for your help

0
Jay_Jay70Commented:
thats ok  -  did you remove the service and just rely on startup?
0
nurbekAuthor Commented:
I used service :)

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

have a good one

cheers :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.