473,386 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Is there any system shutdown code in C From DOS ?

plz i need the code?
bye,
Nov 14 '05 #1
8 3272
sw************@yahoo.co.in (Sweety) wrote in
news:11**************************@posting.google.c om:
plz i need the code?

^^^^^
Please I

There is no such thing as shutdown or DOS in C. You seek an msdos
programming newsgroup or some comp.sources newsgroup maybe.

--
- Mark ->
--
Nov 14 '05 #2
"Mark A. Odell" <od*******@hotmail.com> wrote in message news:<Xn********************************@130.133.1 .4>...
sw************@yahoo.co.in (Sweety) wrote in
news:11**************************@posting.google.c om:
plz i need the code?

char *cmd = "Shutdown";

system(cmd);
Nov 14 '05 #3
plz i need the code?
bye.

which OS are you using?
have a look in this link http://www.tburke.net/info/rundll.htm
there are many system functions that will do that for you, you may also
you asm code.

Nov 14 '05 #4
In <11**************************@posting.google.com > sw************@yahoo.co.in (Sweety) writes:
plz i need the code?


For DOS *only*:

#include <stdio.h>

int main()
{
puts("Please switch the power off.");
while (1) ;
}

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #5
bi*******@yahoo.com (Michael Scarlett) wrote in
news:ce**************************@posting.google.c om:
> plz i need the code?

char *cmd = "Shutdown";

system(cmd);


Not portable in the sense that it may do nothing on an ISO C compliant
implementation, like say an embedded system.

--
- Mark ->
--
Nov 14 '05 #6
Da*****@cern.ch (Dan Pop) wrote in news:cg**********@sunnews.cern.ch:
plz i need the code?
For DOS *only*:


This may also work for other systems as newer machines have a soft power
button that actually shuts down gracefully.

#include <stdio.h>

int main()
{
puts("Please switch the power off.");
while (1) ;
}


--
- Mark ->
--
Nov 14 '05 #7
In <Xn********************************@130.133.1.4> "Mark A. Odell" <od*******@hotmail.com> writes:
bi*******@yahoo.com (Michael Scarlett) wrote in
news:ce**************************@posting.google. com:
> plz i need the code?
char *cmd = "Shutdown";

system(cmd);


Not portable in the sense that it may do nothing on an ISO C compliant
implementation, like say an embedded system.

^^^^^^^^^^^^^^^^^^
Bogus argument: freestanding implementations need not support any of the
standard C library. Your objection to system() is equally valid to
strlen() or malloc() on a freestanding implementation.

The *right* objection to system() is that its argument is highly platform
specific. Then again, this is equally true for fopen's first argument ;-)

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #8
In <Xn********************************@130.133.1.4> "Mark A. Odell" <od*******@hotmail.com> writes:
Da*****@cern.ch (Dan Pop) wrote in news:cg**********@sunnews.cern.ch:
plz i need the code?


For DOS *only*:


This may also work for other systems as newer machines have a soft power
button that actually shuts down gracefully.


There is more than one way of switching the power off ;-)
#include <stdio.h>

int main()
{
puts("Please switch the power off.");
while (1) ;
}


Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 14 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Maarten | last post by:
hallow all earlier i posted a question about shutingdown a computer. there was someone who helped me with the code? i don't know anymore who he was. i remember there was an error in the code,...
5
by: rbt | last post by:
Is it more appropriate to use os.popen or os.system on a windows XP client? I'm calling the operting system's shutdown function like this: restart = os.popen(shutdown -r -f) print restart.read()...
2
by: Andy | last post by:
hi all, I've created a windows server that will watch to make sure another process stays running. It looks for the Process and attaches to the Exited event, which works fine. If the program...
2
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
5
by: msigwald | last post by:
I'm trying to write a little C program to run under linux, which must gain root so it can then shutdown the computer. I can get the code to execute the su command via system("su"), but once su...
3
by: geskerrett | last post by:
We have been asked to develop and application for a client that is a 'notification" system. We would like to use python, but are struggling to find the right starting point. Any suggestions, tips...
2
by: Sin Jeong-hun | last post by:
I created a windows form application. It has a Threading.Timer and when the timer ticks it does some work and show a popup window. The problem is that while this program is running if the user...
0
by: Varan | last post by:
hai, now we are using batch file for take backup at time of start services and stop services. we need option for take database backup at time 1. System Start ...
4
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, can someone please show me a working Example of how i can create a process on a remote system (does not need UI) with WMI using C#? Thanks in advance,... Regards
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.