Solved

how to reboot system in safe mode with networking in vc++

Posted on 2010-11-26
15
602 Views
Last Modified: 2013-11-20
Hello expert
I want to create a application that reboot the system with networking. how is it possible in c++,vc++.  i alos want to revert back with normal mode. please give me sample if any one or give me your valuable idea. please reply me as soon as possible.
waiting your Response
Thanks
SHIVA
0
Comment
Question by:shivani98
  • 5
  • 3
  • 3
  • +2
15 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 250 total points
ID: 34218725
ExitWindowsEx can be used to shutdown (and reboot) but as for restarting in a 'safe' mode that I don't know how, or even if it is possible.
0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 250 total points
ID: 34218755
Well, the bad news is, it is not possible by "official" means (and I don't even know any hacks) - see http://msdn.microsoft.com/en-us/library/aa376881%28VS.85%29.aspx ("Shutting Down"), which documents all three ways to shut down Windows via an API.
0
 
LVL 9

Expert Comment

by:Subrat (C++ windows/Linux)
ID: 34218782
I guess there might be a way to reboot with networking by setting some key, value in registry and using ExitWindowsEx () as already advised by AndyAinscow.

Just google the registry key...
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

 

Author Comment

by:shivani98
ID: 34220609
Sir basically i want to edit BOOT>INI file and add the following multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect . how to do it by c++. please give me sample.
Thanks
Shiva
0
 
LVL 9

Expert Comment

by:Subrat (C++ windows/Linux)
ID: 34223909
you need to know file handling in c++. Just google it.
http://www.cplusplus.com/reference/iostream/

Also need to set the permission of the file that you want to modify.
0
 
LVL 9

Expert Comment

by:Subrat (C++ windows/Linux)
ID: 34223918
0
 
LVL 86

Expert Comment

by:jkr
ID: 34224025
You are aware that your advice is more than dangerous? You don NOT WANT to tamper with boot.ini in ANY WAY. Period. Chances are that the system will not boot at all if something goes wrong.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34225613
I'd agree with jkr - get it wrong and you have major problems.
If you do want that then at least make certain the disc is formatted with FAT32 (not NTFS) so you could at least boot to floppy / CD and use an editor to put a functional version of boot.ini into place.
0
 

Author Comment

by:shivani98
ID: 34237367
sir basically i want to restart my xp system in safe mode with networking. this is my requuirement. so if you have idea then give me how is it possible? is there any command for xp.  i have already done it by Windows 7 and vista. but i have not done in it xp. so please give me idea.
Thanks for your valuable time
Shiva
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34237482
>>basically i want to restart my xp system in safe mode with networking.

At the command prompt type in
msconfig then press enter
Select the boot.ini tab
click the checkbox for safe mode
now click the radio for networking
reboot your system
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34237491
To get into a normal reboot
At the command prompt type in

    * msconfig then press enter


    * Select the boot.ini tab


    * uncheck the checkbox for safe mode    


    * reboot your system

0
 

Author Comment

by:shivani98
ID: 34239463
if possible please send the command. i am not getting you properly.
Waiting your response.
Shiva
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 34239522
You want to reboot YOUR pc in safe mode with networking you now say.

So follow the instructions:

At the command prompt (the little box you can enter a command in when you display the menu at the bottom left of the XP screen - might be called 'run' or similar) type in

    * msconfig then press enter - the config utility starts


    * Select the boot.ini tab - third or fourth tab, called boot.ini


    * click the checkbox for safe mode - about half way down


    * now click the radio for networking - to the right of the 'safemode' checkbox


    * reboot your system
0
 
LVL 40

Expert Comment

by:evilrix
ID: 34824150
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
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

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

829 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