• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 784
  • Last Modified:

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

0
nurbek
Asked:
nurbek
  • 5
  • 4
  • 4
2 Solutions
 
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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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
 
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

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 5
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now