Re: BAT file to re-start in Safe Mode...?




"Kenneth" <usenet@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4odld4tjb8a4g76634b53n962br968pi5h@xxxxxxxxxx
On Wed, 24 Sep 2008 22:50:26 +0200, "Pegasus \(MVP\)"
<I.can@xxxxxxxxxx> wrote:


"Kenneth" <usenet@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:il8ld4p7vp8krr1loks2hltsg0bo6bf4cc@xxxxxxxxxx
On Wed, 24 Sep 2008 07:35:01 +0200, "Pegasus \(MVP\)"
<I.can@xxxxxxxxxx> wrote:


"Kenneth" <usenet@xxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:644jd4hue0ten96l4gcs4i2ovqg5at1has@xxxxxxxxxx

Howdy,

I have a simple batch file that dumps 4000 contacts from my
database to a TXT file, and then imports them to my
Contacts.

Recently, that last phase has been producing some errors
indicating a problem with the command line text that does
the import. This happens intermittently.

The folks who support the importing software (Contact Genie)
tell me that the command line text is fine (as I would
assume because it usually works properly), and they believe
that something is corrupting the command line text
preventing their software from correctly interpreting it...

I have experimented with the simple work-around of running
the BAT file in Safe Mode with Networking, and this seems to
work.

So, with all that as introduction, here is my question:

Is there a way for me to modify the BAT file so that it
says, in effect, "re-boot into Safe Mode with Networking,
run this routine, then re-boot into full XP?"

Many thanks for any help on this,
--
Kenneth

If a program works in Safe Mode but fails in Normal Mode then you have
an
agent running in Safe Mode that intereferes with your program. The usual
method to resolve this problem is based on isolating and removing the
interfering agent.

To boot into safe mode, you need to maintain two versions of the hidden
file
c:\boot.ini, e.g. c:\boot.norm and c:\boot.safe. The file c:\boot.safe
should have this line:
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP
Professional" /fastdetect /noexecute=optin /safeboot:minimal
whereas the file c:\boot.norm lacks the /safeboot:minimal switch.

You also need a batch file c:\windows\MyBoot.bat with these lines
inside:
@echo off
if /i "%1"=="Safe" (
copy /y c:\boot.safe c:\boot.ini
shutdown /.. /..
) else (
copy /y c:\boot.norm c:\boot.ini
)

And here is how you put it all together:

1. Create a shortcut on your desktop. Call it "Boot into Safe Mode" and
point it at c:\windows\MyBoot.bat with a parameter of "Safe" (without
the
double quotes!).
2. Create a scheduled task. It should invoke c:\windows\MyBoot.bat and
it
run at boot time.

That's all. Now each time you double-click "Boot into Safe Mode", the
machine will reboot in Safe Mode. The next time it will boot normally.

Enjoy!


Hi Pegasus,

There is one thing in your suggestion that I don't
understand...

You wrote:

1. Create a shortcut on your desktop. Call it "Boot into
Safe Mode" and point it at c:\windows\MyBoot.bat with a
parameter of "Safe"
double quotes!).

but I don't know how to add the Safe parameter.

Also, I need Safe with Networking, so in any case I need a
bit more information.

Many thanks,
--
Kenneth


After creating the shortcut, right-click it, then click "Properties". Now
add a space to the far end in the "Target" box and type "Safe". It's as
simple as that!

You previously wrote that you found the switch "/safeboot:network" after
some sniffing about. This sounds quite reasonable. I suggest you try it
out.
If it does not work, do some more sniffing and report the result here - I
would have to do the same thing too!


Hi again,

I modified the Target as per your description, and the
shortcut points to:

@echo off if /i "%1"=="Safe" (copy /y c:\boot.safe
c:\boot.ini shutdown /.. /..) else
(copy /y c:\boot.norm c:\boot.ini)


I have the other bat files just as you have described.

But, when I fire up the shortcut, all that happens is a
momentary flash of the command line. The system does not
reboot.

That is true whether I set the shortcut target parameter to
safe, or to safe:network.

In the hope that you might spot the problem, I will include
everything I have done.

C:\boot.norm consists of:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
Windows XP Professional" /noexecute=optin /fastdetect

(I just pasted in my present boot.ini. Was that what you
intended?)



C:\boot.safe consists of:

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
Windows XP Professional" /fastdetect /noexecute=optin
/safeboot:network




c:\windows\MyBoot.bat consists of:

@echo off if /i "%1"=="Safe" (copy /y c:\boot.safe
c:\boot.ini shutdown /.. /..) else
(copy /y c:\boot.norm c:\boot.ini)

(Does the above need the [boot loader] line?)


and finally, I have a scheduled task that calls
c:\windows\MyBoot.bat and runs at boot.

Sincere thanks for any further help,
--
Kenneth

If you email... Please remove the "SPAMLESS."

I can see a few problems in your approach. Firstly, your batch file has the
lines broken up differently from the way I put them. Here is what I wrote:
@echo off
if /i "%1"=="Safe" (
copy /y c:\boot.safe c:\boot.ini
shutdown /.. /..
) else (
copy /y c:\boot.norm c:\boot.ini
)
You must not take liberties when copying & pasting this file.

Secondly, the file c:\boot.safe must be an exact copy of the file
c:\boot.norm, with this switch added to the last line: /safeboot:network.

After making these changes, you MUST test your batch file. You do it in a
Command Prompt so that you can see what's going on. Here is how it's done:
1. Click Start/Run/cmd{OK}
2. Type the following commands:
type c:\boot.ini{Enter}
(Examine what you see on the screen)
MyBoot.bat Safe {Enter}
type c:\boot.ini(Enter)
(Examine the screen again. You should see the "/safeboot" switch.)
MyBoot.bat{Enter}
type c:\boot.ini{Enter}
(Examine the screen again. There should be no "/safeboot" switch.)
If there are error messages then you must make a note of them.


.



Relevant Pages

  • Re: Batch needs lots of intervention...?
    ... Net, run two programs, and finally boot the system into ... echo XP boot in safe mode>c:\safemode ... I launch the batch file from a shortcut. ... Check this link about your first automatic logon: ...
    (microsoft.public.windowsxp.general)
  • Re: Batch needs lots of intervention...?
    ... Net, run two programs, and finally boot the system into ... echo XP boot in safe mode>c:\safemode ... I launch the batch file from a shortcut. ... Check this link about your first automatic logon: ...
    (microsoft.public.windowsxp.general)
  • Re: XP extremely slow boot up
    ... regular mode and then in safe mode and checked the event log. ... The Event Viewer is accessible in safe mode. ... boot in normal mode. ... On how to disable the Add-ons follow this: ...
    (microsoft.public.windowsxp.general)
  • Re: Nothing on screen?
    ... hour trying to boot in safe mode. ... As a last resort I was going to try to do the repair installation of windows ... Go into the System BIOS - can you get around in the System BIOS? ... Exit System BIOS and boot the System in Safe Mode again. ...
    (microsoft.public.windowsxp.general)
  • Re: HP 1310n (AMD ATHON Processor and SP3 UPDATE
    ... Continual reboots or can only boot into Safe Mode after installing WinXP SP3? ... into normal (Windows) mode. ... Creating a backup copy of the registry for MicrosoftWindows XP: ...
    (microsoft.public.windowsupdate)

Loading