?
Solved

Running a process in Windows 2000 Before Logon

Posted on 2003-02-28
15
Medium Priority
?
177 Views
Last Modified: 2010-04-13
I would like to run a command in Windows 2000 to inform a console that the PC has rebooted. I only want to do this once.

I tried adding a key to the runonce key in the registry for "NET SEND CONSOLE Rebooted". This works but only when someone signs onto the PC. How can I do this at startup but before the user signs on.

Urgent response requested, hence the high points.
0
Comment
Question by:wilsontony
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +3
15 Comments
 
LVL 10

Expert Comment

by:makerp
ID: 8040967
the best way to do this is write a service; services get started when the machine boots up windows. they are executed before logon.

you will need to write one
regsiter it
set it to start automatically....

can you program....
0
 
LVL 32

Expert Comment

by:jhance
ID: 8041160
As already noted, the only things that run WITHOUT an interactive logon are SERVICES.  This is what they are for.

Let me suggest Kevin Miller's book on the subject, "Windows NT Services" published by WROX.
0
 

Author Comment

by:wilsontony
ID: 8041223
I only want to run this ONCE. If I create a service it will run it everytime. I do not want to make too drastic a change to the PCs.

Thanks for the comments.
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 10

Expert Comment

by:makerp
ID: 8041258
just have your service use the system("NET SEND machine message") then exit. that way it will execute once when the system is started then it will die.

>>I do not want to make too drastic a change to the PCs.

then if you consider registering a service drastic then go tell your manager it is not possible to do what he/she wants.... then maybe collect your coat, ask for your p45 to be sent straight to you home address and go home
0
 

Author Comment

by:wilsontony
ID: 8041312
If I could make the service unregister itself as soon as it runs the first time then this may be acceptable.

I would be doing this remotely via WMI so ideally the solution would be as simple as possible. I thought someone may have some cute way of doing this and that is the reason I posted this question.

As an MCSE/2000 with over 10 years experience, please spare me the P45 quips!
0
 
LVL 32

Expert Comment

by:jhance
ID: 8041398
I HARDLY consider a SERVICE to be "drastic".  Under Windows NT/2000/XP a service is simply an application that runs without an interactive user.

There is no requirement that a service continue running.  It can simply start, do its thing, and then terminate.

I'll just 2nd makerp's sentiment that if you consider this "drastic" that you are unqualified to do what you as being asked to do.

Once again, I refer you to Miller's book.  It will help you learn something new, help you solve this problem, and make you a better and potentially more valuable employee.
0
 
LVL 10

Expert Comment

by:makerp
ID: 8041546
>>If I could make the service unregister itself as soon as it runs the first time then this may be acceptable.

why would you want to do that; then youll have to re-register it before each time you were going to re-boot. do you only want this to run ONLY ONCE or every time it re-boots. if ONLY ONCE then may i suggest that you phone call the effected people, this will probably be cheaper...... if you want it to run when ever the machine starts then you need to regsiter it ONCE on the PC and then forget about it.
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 8041885
Well you could use the task Scheduler and schedule it to run at system startup. Then put a batch file in the RunOnce key to delete the scheduled task

DEL C:\WINNT\Tasks\TheTask.job

Of couse I am sure you know you need to include a User and the Password for the user in the sheduled task. In this case one with admin privleges.


The Crazy One
0
 
LVL 44

Expert Comment

by:CrazyOne
ID: 8041920
As far as running it as a service you could let the service run and then in the RunOne put in a batch file to run this command

TheDrive\TheFolder\TheService /uninstall
0
 
LVL 2

Expert Comment

by:bonzai
ID: 8042535
i would do this via group policy Startup script

(mmc - add remove snap-in - group policy)

There, browse to "local Computer Policy - Windows sttings - Scripts(Startup/Shutdown)

add a batchfile with about the following content:

--------------
net send %console% Rebooted
del thisbatchfile.bat
--------------



0
 
LVL 2

Accepted Solution

by:
bonzai earned 1500 total points
ID: 8042554
i would do this via group policy Startup script

(mmc - add remove snap-in - group policy)

There, browse to "local Computer Policy - Windows sttings - Scripts(Startup/Shutdown)

add a batchfile with about the following content:

--------------
net send %console% Rebooted
del thisbatchfile.bat
--------------



0
 

Expert Comment

by:smadaras
ID: 8046314
Bonzai has exactly the right answer. Forget about that Service nonsense.
0
 
LVL 2

Expert Comment

by:bonzai
ID: 8051639
huh... thank you smadaras... feeling verry embarrassed :-)
0
 

Expert Comment

by:smadaras
ID: 8052320
The one thing I would add to bonzai's response is that I would use a vbscript, which sets and then checks a reg key, instead of deleting the batch file. With that scenario you can put the startup script in any GPO, site, domain or OU.
0
 

Author Comment

by:wilsontony
ID: 8055472
Thanks for all the comments guys. You were all really helpful
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question