the codes

zeezeiler99

Baseband Member
Messages
91
Location
netherlands
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
 
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
 
@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
 
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)
 
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.
 
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.
 
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.
 
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.
 
Back
Top Bottom