![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Programming A discussion forum for programs and programming used in tech-related businesses. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
program to remove "windows is now running in safe mode"
hey guys,
i'm not sure whether this belongs here or not. i work in a computer repair shop. lately, in my spare time, i've been writing a batch file that does a lot of the work we would do when repairing virus related issues. at one point, the batch file puts itself into the "run once" part of the registry, and reboots into safemode, to repair permissions. however, i forgot that on xp machines there is a message that pops up that says "xp is now running in safe mode." this is pretty annoying because the whole point of the batch file is to allow me or one of my coworkers to leave the computer to do its own thing. does anyone know of any command i could add to my batch file that would get rid of this message temporarily? maybe there's some kind of registry edit i could do and then undo? any help would be appreciated. |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#2 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,854
OS: Vista, various linux distros
|
Re: program to remove "windows is now running in safe mode"
Pretty sure it's written into the packaged drivers so removing the actual message is an effort. You could however use some form of macro language to rid of the message once it's running, then maybe compile it and throw it into the start of your batch file for SM. May i suggest throwing together an AutoHotkey/AutoIt script to step up from batch to a macro language? (Google the names, AutoHotkey is easier to use for this sort of thing)...
Other than that all i can think of is checking out msconfig.exe and under the boot section seeing if there's a message surpression thing? Godknows to be honest but i think it's there to stay, so a work around is the way i'd go about it. Cheers, Jamey |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
that's a great idea actually.
i don't know much about using these scripts though so i'm not really sure how to do it. also, that message is the first thing to come up, and, if i remember correctly, i don't think the machine will finish loading xp until "yes" is hit on the message. would i run into the same problem with the script here as i did with my batch file? |
|
|
|
|
|
#4 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
http://www.pctools.com/guides/registry/detail/214/
i found that while doing some research, but it looks like it only supports older versions of windows, and i need xp and vista. |
|
|
|
|
|
#5 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,854
OS: Vista, various linux distros
|
Re: program to remove "windows is now running in safe mode"
Okay, well autohotkey's site has a brilliant getting started which will cover this through and through, obvious advantages are, ability to add gui, in depth file commands, pre-programmed routines to work with complex strings/files/reg info/whatever else. But yes, i've seen the wall that's hit there. Though i've found a solution, i can't test it myself because i'm running vista(eww), but it's one that will do the job: http://www.pctools.com/guides/registry/detail/214/
Give it a go and get back. Cheers, Jamey Edit: we hit that link at the same time |
|
|
|
|
|
#6 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
hahaha that's the link i just posted! it looks like it doesn't even work in xp.
by the way, i know that vista comes up with a similar message, but does it not allow you to do anything until responding to it? so far my batch file works in xp and vista, i don't want to lose that. |
|
|
|
|
|
#7 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,854
OS: Vista, various linux distros
|
Re: program to remove "windows is now running in safe mode"
I've never seen the same message in vista =S godknows why that is, but it's just not popped up before, i remember the message from XP though.
I guess it's probably to do with limiting automated access (Basically because if someone can screw with you in safe mode they've got you at the core)... I'm going to keep looking for a solution, but i doubt it will be an easy one. Cheers, Jamey |
|
|
|
|
|
#8 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,854
OS: Vista, various linux distros
|
Re: program to remove "windows is now running in safe mode"
Have you tried going through MSConfig to boot in safe mode minimal/CommandPrompt(i think it might not throw the message when you use CP[honestly don't remember])/the different versions of safe mode?
Cheers, Jamey |
|
|
|
|
|
#9 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,854
OS: Vista, various linux distros
|
Re: program to remove "windows is now running in safe mode"
Alright, i'm off to bed, but tomorrow i'll hae a play about with my XP machine and see if i can work this out (it has become an "i must do this" sort of puzzle thing). Sure it's do-able.
|
|
|
|
|
|
#11 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
so i found that by booting into safe mode with an alternate shell, this message doesn't come up. this is because the alternate shell is the command prompt in stead of explorer.exe. when i did this, i found that the "run once" registry key won't run in safe mode! that is unless for some reason explorer.exe needs to be running. so now i think, i can boot into safe mode without the message coming up, but i can't start the batch file!
heres a copy of the batch file that is supposed to run the program i want to run in safe mode. ------------------------------------------------ @echo off start notepad.exe start.txt control userpasswords2 pause Echo. Press any key to begin myprogram copy myprogram.lnk C: (this is to copy a shortcut of myprogram to the c drive) reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce /v myprogram /t REG_SZ /d C:\myprogram.lnk /f > nul Find "default=" C:\boot.ini > default For /f "skip=2 tokens=2,3* delims== " %%i IN (default) DO @set default=%%i For /F "tokens=5,6* skip=4 delims=: " %%i IN (C:\boot.ini) DO @set mode=%%k If "%mode%" == "/safeboot:minimal(alternateshell)" ( Echo Safe mode detected. Goto runnormalmode ) Else ( Echo Normal mode detected. Goto runsafemode ) Goto end :runsafemode attrib C:\boot.ini -s -r -h echo> C:\boot.ini [boot loader] echo>> C:\boot.ini timeout=30 echo>> C:\boot.ini default=%default% echo>> C:\boot.ini [operating systems] echo>> C:\boot.ini %default%="Windows XP Safe Mode" /noexecute=alwaysoff /fastdetect /safeboot:minimal(alternateshell) Echo. Your PC is now set to start in Safe Mode. attrib C:\boot.ini +h +r +s Goto end :runnormalmode attrib C:\boot.ini -s -r -h echo> C:\boot.ini [boot loader] echo>> C:\boot.ini timeout=30 echo>> C:\boot.ini default=%default% echo>> C:\boot.ini [operating systems] echo>> C:\boot.ini %default%="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetect Echo. Your PC is now set to start normally. attrib C:\boot.ini +h +r +s Goto end :end Del default Set mode= Set default= Shutdown -r --------------------------------- userpasswords2 is used to remove the need for a password when logging in, so it doesn't require any touch time half way through. start.txt is just some instructions on what to do in userpasswords2 any ideas? Last edited by jash; 05-31-2009 at 08:07 PM. |
|
|
|
|
|
#12 (permalink) |
|
TSF Enthusiast
Join Date: Mar 2009
Location: Portland, OR
Posts: 815
OS: MS-Dos 6.22 - Win7
|
Re: program to remove "windows is now running in safe mode"
Put the path and name of your batch file here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor in the AutoRun string. This is usually null, but you may want to save it first. It may not be present. Code:
Reg Export "HKLM\SOFTWARE\Microsoft\Command Processor" C:\HKLMCP.txt Reg Add "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /T REG_SZ /d "C:\Scripts\Test.cmd" /F When finished in safe mode, before rebooting, restore the previous key: Code:
Reg Delete "HKLM\SOFTWARE\Microsoft\Command Processor" /F Reg Import C:\HKLMCP.txt Del C:\HKLMCP.txt Jerry
__________________
Microsoft MVP - Windows Desktop Experience Of course I know all the answers; I just don't always match the answers to the right questions. Rated R for Violence -- When your PC flies through a window, that's violent, right? |
|
|
|
|
|
#15 (permalink) | |
|
TSF Enthusiast
Join Date: Mar 2009
Location: Portland, OR
Posts: 815
OS: MS-Dos 6.22 - Win7
|
Re: program to remove "windows is now running in safe mode"
Quote:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor in the AutoRun string./QUOTE] Just specify the path to the batch file.
__________________
Microsoft MVP - Windows Desktop Experience Of course I know all the answers; I just don't always match the answers to the right questions. Rated R for Violence -- When your PC flies through a window, that's violent, right? |
|
|
|
|
|
|
#16 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
oh i see. can i use the batch file to create a shortcut on say, the root so that it doesn't matter where i place the program? i know how to copy files, but i don't know any way to make shortcuts.
|
|
|
|
|
|
#17 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
anyway i tried it and got "Error: invalid key name"
haha i feel like i'm doing something stupid --------------------------- @echo off start notepad.exe start.txt control userpasswords2 pause Echo. Press any key to begin superJ Reg Export C:\"system analyzer"\superJ.bat C:\HKLMCP.txt Reg Add C:\"system analyzer"\superJ.bat /v AutoRun /T REG_SZ /d "C:\Scripts\Test.cmd" /F pause Find "default=" C:\boot.ini > default For /f "skip=2 tokens=2,3* delims== " %%i IN (default) DO @set default=%%i For /F "tokens=5,6* skip=4 delims=: " %%i IN (C:\boot.ini) DO @set mode=%%k If "%mode%" == "/safeboot:minimal" ( Echo Safe mode detected. Goto runnormalmode ) Else ( Echo Normal mode detected. Goto runsafemode ) Goto end :runsafemode attrib C:\boot.ini -s -r -h echo> C:\boot.ini [boot loader] echo>> C:\boot.ini timeout=30 echo>> C:\boot.ini default=%default% echo>> C:\boot.ini [operating systems] echo>> C:\boot.ini %default%="Windows XP Safe Mode" /noexecute=alwaysoff /fastdetect /safeboot:minimal(alternateshell) Echo. Your PC is now set to start in Safe Mode. attrib C:\boot.ini +h +r +s Goto end :runnormalmode attrib C:\boot.ini -s -r -h echo> C:\boot.ini [boot loader] echo>> C:\boot.ini timeout=30 echo>> C:\boot.ini default=%default% echo>> C:\boot.ini [operating systems] echo>> C:\boot.ini %default%="Microsoft Windows XP Professional" /noexecute=alwaysoff /fastdetect Echo. Your PC is now set to start normally. attrib C:\boot.ini +h +r +s Goto end :end Del default Set mode= Set default= Shutdown -r Last edited by jash; 06-02-2009 at 11:16 AM. |
|
|
|
|
|
#19 (permalink) | |
|
TSF Enthusiast
Join Date: Mar 2009
Location: Portland, OR
Posts: 815
OS: MS-Dos 6.22 - Win7
|
Re: program to remove "windows is now running in safe mode"
Quote:
The format for Reg Export is: Reg Export <keyname> <filename> <Keyname> in this case is "HKLM\SOFTWARE\Microsoft\Command Processor" Filename is anything you chose, my example used C:\HKLMCP.txt. This is just to save the current registry settings. Note that this won't work on Vista as you can't create files in the root of the drive The format for Reg Add is: Reg Add <keyname> /V <valuename> /T <type> /D <data> /F <Keyname> in this case is "HKLM\SOFTWARE\Microsoft\Command Processor" <valuename is AutoRun <type> is REG_SZ Data is the name of the file you want to run: "C:\system analyzer\superJ.bat" The /F forces an overwrite if the AutoRun key already exists. The parts in red must be exactly as shown. The parts in blue you change to fit your filenames. So use this and only change the parts in blue as needed: Code:
Reg Export "HKLM\SOFTWARE\Microsoft\Command Processor" C:\HKLMCP.txt Reg Add "HKLM\SOFTWARE\Microsoft\Command Processor" /v AutoRun /T REG_SZ /d "C:\system analyzer\superJ.bat" /F When the system reboots to safe mode, the superj.bat file is run. When that file finishes, it needs to remove the registry entry and reconfigure the boot.ini file to boot to normal mode. I'm assuming the superj.bat file is not the one you've posted. If it is, then this part: Code:
start notepad.exe start.txt control userpasswords2 pause Echo. Press any key to begin superJ To restore the registry and clean up, you'd use these three commands: Reg Delete "HKLM\SOFTWARE\Microsoft\Command Processor" /V AutoRun /F Reg Import C:\HKLMCP.txt Del /F C:\HKLMCP.txt You first delete the AutoRun key in case one did not previously exist, then import the settings you saved. HTH Jerry
__________________
Microsoft MVP - Windows Desktop Experience Of course I know all the answers; I just don't always match the answers to the right questions. Rated R for Violence -- When your PC flies through a window, that's violent, right? |
|
|
|
|
|
|
#20 (permalink) |
|
Registered User
Join Date: Aug 2007
Posts: 120
OS: windows xp
|
Re: program to remove "windows is now running in safe mode"
thanks for the more detailed post. i'll give that a try tonight.
i was running the user accounts applet was so the machine was so that when the machine rebooted a user did not need to be selected, and the machine would just go right past the welcome screen. |
|
|
|
![]() |
| Thread Tools | |
|
|