Solved

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

Posted on 2010-11-26
15
593 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
Comment Utility
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
Comment Utility
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 8

Expert Comment

by:Subrat (C++ windows/Linux)
Comment Utility
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
 

Author Comment

by:shivani98
Comment Utility
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 8

Expert Comment

by:Subrat (C++ windows/Linux)
Comment Utility
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 8

Expert Comment

by:Subrat (C++ windows/Linux)
Comment Utility
0
 
LVL 86

Expert Comment

by:jkr
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
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
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
Comment Utility
if possible please send the command. i am not getting you properly.
Waiting your response.
Shiva
0
 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

728 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now