How to execute a bat script every startup, even in SafeMode?

G

groups.observer

Hi all!

I've set up a Win2k Pro SP3 computer as a server, with auto login
enabled. To protect the system, I've created a bat file that resides
in my startup folder (Start > Programs > Startup). It automatically
locks the system after startup.

The problem is, it's not executed when the system runs in safe mode.
I've tried to run it by creating a registry key under
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
[LockWorkstation] *"C:\LockWorkstation.bat" (having copied the file to
that location), but it doesn't execute (despite the asterisk).

Any ideas how to get that system locked at startup when it runs in
safe mode? :)

Kind regards,

Christian
P.S.: Windows Update is enabled. Any ideas why Windows identifies as
SP3 in safe mode?
 
C

Christian

Hi Dave,

I finally got some time to try it out. However, the installer
complained it would only support Win XP and Win 2003. I used 7zip to
extract the files anyway. The last question I have before I actually
do go ahead:

In the batch file, I've got the following line:
rundll32.exe user32.dll,LockWorkStation

When installing this as a service, are you absolutely sure it will
only run _once_, at start up?
The last thing I need is a service that's going to log me off the very
second I logged me back in... ;o)

Kind regards,

Christian
 
D

Dave Patrick

You seem to have missed the point. I'd run the application as a service so
the computer doesn't need to be logged on.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
C

Christian

Hi Dave,

You're probably right. But let's sum up: I've got a Win2k Pro acting
as a file and print server. Both, file sharing and printing from a
"Client" don't work properly for whatever reason when the "server" is
not logged in. That's why the server now logs in automatically. To
protect it, I'd like to lock it automatically, too. This can be
achieved by placing a link pointing to a batch file in either the
registry or the auto start folder. However, this doesn't work when
someone boots in safe mode. Those links are ignored in that case. So I
was looking for a way to start that batch file _once_ after a log in
to protect the server, even in safe mode. From what you wrote, I
thought a service that runs even in safe mode might do the trick. And
the tools you mentioned seemed to be all I need to turn said batch
file into a service. Of course, I do _not_ want something that
continuously locks the "server" (=locks it as soon as it's unlocked),
as it would make it impossible to do maintenance work on it (e. g.
installing/updating programs).

Making sure file and printer sharing run without having to log in
might also be a solution. However, I don't know what programs I'd have
to turn into a service to achieve that. Besides, I thought usually
this ought to work without logging in anyway. Which it currently
doesn't. Also, I'm not sure the virus scanner and firewall would
actually start completely before logging in.

So, again, my problem is: How do I lock the "server" after it has
logged in? :)

Kind regards,

Christian
 
D

Dave Patrick

"file sharing and printing from a "Client" don't work properly for whatever
reason when the "server" is not logged in."

If you can post more details someone may be able to help. I'd start with the
event log.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect
 
Joined
Jun 13, 2012
Messages
1
Reaction score
0
Hi every one

I have a problem some how like Christian.

I want to run a program in startup but in sn safe mode.

I have tried Regedit but it didn't work .

who can elp me? I'm in a hurry.

Regards,
Iman
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top