We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

run program before logon

nurbek
nurbek asked
on
Medium Priority
801 Views
Last Modified: 2009-12-16
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

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2006
Commented:
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!

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT

Author

Commented:
as a service it works

but I need to see the GUI when I login

Is it possible?

Commented:
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.
Commented:
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.
CERTIFIED EXPERT

Author

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



Commented:
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.

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

http://www.iopus.com/guides/srvany.htm
CERTIFIED EXPERT
Top Expert 2006

Commented:
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
CERTIFIED EXPERT

Author

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

 
CERTIFIED EXPERT

Author

Commented:
Thanks for your help

CERTIFIED EXPERT
Top Expert 2006

Commented:
thats ok  -  did you remove the service and just rely on startup?
CERTIFIED EXPERT

Author

Commented:
I used service :)

I cant see the GUI, hope that program is running acuurately :)
CERTIFIED EXPERT
Top Expert 2006

Commented:
alright man

have a good one

cheers :)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.