Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 08-13-2013, 04:56 PM   #1
Baseband Member
 
zeezeiler99's Avatar
 
Join Date: Aug 2013
Location: netherlands
Posts: 91
Default the codes

hello,

i like scripts a lot, but i dont understand the codes yet.
i know that @echo off will repeat the script and that pause stops it.
the code: shutdown -s -l 10 -c ''bye'' will shutdown your system and it wil open something that says bye. so -s would be the command to shutdown a system and -c to open something there you can enter text in.
would you enter some more - codes in replies and can you explain what they do?

greetings

Joost
__________________

zeezeiler99 is offline   Reply With Quote
Old 08-14-2013, 07:14 AM   #2
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: the codes

You can find all this by doing "shutdown --help" - in fact appending "--help" to most commands will produce some form of output describing how to use that command and its arguments. In this case, the "c" stands for comment, and is meant to provide a reason for the shutdown - "essential maintenance" or "power failure" for instance.

What do you mean by other codes? Do you mean other commands you can use in the Windows command line? If so then you can find a list of them here: An A-Z Index of the Windows CMD command line | SS64.com
__________________

__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 08-16-2013, 12:43 PM   #3
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,003
Default Re: the codes

@echo off does not repeat the script.

the simplest thing is to write a batch file

Code:
dir
when this is run you'll see the output shows the command and the output from the command.

Code:
echo off
dir
this batch file is slightly different, now it says echo off in the output window and shows you the output of the command, but doesn't tell you what the command was

Code:
@echo off
dir
this doesn't tell you that you turned echo off, if just turns of command echoing to the console silently, and only shows outputs of the command

you can turn echo back on by using echo on.

for looping you need to use line labels
Code:
@echo off
:start
echo Hello, 
goto :start
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 08-16-2013, 02:34 PM   #4
In Runtime
 
lhamil64's Avatar
 
Join Date: Jan 2007
Posts: 398
Default Re: the codes

Quote:
Originally Posted by berry120 View Post
You can find all this by doing "shutdown --help" - in fact appending "--help" to most commands will produce some form of output describing how to use that command and its arguments. In this case, the "c" stands for comment, and is meant to provide a reason for the shutdown - "essential maintenance" or "power failure" for instance.

What do you mean by other codes? Do you mean other commands you can use in the Windows command line? If so then you can find a list of them here: An A-Z Index of the Windows CMD command line | SS64.com
Actually, in Windows it's /? and not --help (unless --help works too, I tried it with the shutdown command but I think it showed the help because it didn't recognize the arguments)
__________________
--Lee
Website/Blog: http://lhamil64.wordpress.com
lhamil64 is offline   Reply With Quote
Old 08-21-2013, 09:50 PM   #5
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: the codes

Quote:
Originally Posted by lhamil64 View Post
Actually, in Windows it's /? and not --help (unless --help works too, I tried it with the shutdown command but I think it showed the help because it didn't recognize the arguments)
There's no real standard, but yes "/?" is quite common in the windows world, so you're probably correct there! I live more in the "everything else" territory which usually takes -help or --help (or similar.) No sure fire way though.
__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Old 08-23-2013, 07:18 PM   #6
In Runtime
 
lhamil64's Avatar
 
Join Date: Jan 2007
Posts: 398
Default Re: the codes

Quote:
Originally Posted by berry120 View Post
There's no real standard, but yes "/?" is quite common in the windows world, so you're probably correct there! I live more in the "everything else" territory which usually takes -help or --help (or similar.) No sure fire way though.
Yeah, I generally prefer Unix/Linux style terminals as opposed to the Windows CLI, they just seem a lot more powerful.
__________________
--Lee
Website/Blog: http://lhamil64.wordpress.com
lhamil64 is offline   Reply With Quote
Old 08-24-2013, 04:45 AM   #7
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,003
Default Re: the codes

The shell is no more powerful between Linux and windows, just the shell tools are a hell or a lot better!

Have a look at gnuwin32 to bring a little but of the power of Linux command line tools to your windows desktop.

(Most useful are probably, more less and grep) the one I tend to use the most is jwhois.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 08-25-2013, 09:08 PM   #8
Site Team
 
berry120's Avatar
 
Join Date: Jul 2009
Location: England, UK
Posts: 3,425
Default Re: the codes

Quote:
Originally Posted by root View Post
The shell is no more powerful between Linux and windows, just the shell tools are a hell or a lot better!

Have a look at gnuwin32 to bring a little but of the power of Linux command line tools to your windows desktop.

(Most useful are probably, more less and grep) the one I tend to use the most is jwhois.
Well, the tools are a lot better on *nix then

The one I always find most limiting is the lack of an equivalent find and xargs - being able to do a simple one liner to clear out all the .svn directories for instance using find, xargs and rm -rf is just so much cleaner than writing a few lines of bash script with a few gotos...

...or as you say, install gnuwin32.
__________________

__________________
Save the whales, feed the hungry, free the mallocs.
berry120 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 06:38 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0