| 1. |
Solve : Spaces in directory names? |
|
Answer» I'm new to programming, and I require assistance with a minor problem. Note that if you are in a batch file, use shutdown.exe instead of shutdown. Using the .exe extension is optional, whether an executable is in the current folder, or on the PATH. The only reason to explicitly add the extension would be if you had a different executable eg shutdown.com shoutdown.bat or shutdown.cmd in either of those places. (Bad practice!) If shutdown.exe is where it should be, ie C:\WINDOWS\system32, then shutdown or shutdown.exe will find it. Or am I missing something? Code: [Select]c:\>shutdown /? USAGE: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\>shutdown.exe /? Usage: shutdown.exe [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\>echo shutdown /? > ss.bat c:\>echo shutdown.exe /? >> ss.bat c:\>ss c:\>shutdown /? Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\>shutdown.exe /? Usage: shutdown.exe [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy] No args Display this message (same as -?) -i Display GUI interface, must be the first option -l Log off (cannot be used with -m option) -s Shutdown the computer -r Shutdown and restart the computer -a Abort a system shutdown -m \\computername Remote computer to shutdown/restart/abort -t xx Set timeout for shutdown to xx seconds -c "comment" Shutdown comment (maximum of 127 characters) -f Forces running applications to close without warning -d [u][p]:xx:yy The reason code for the shutdown u is the user code p is a planned shutdown code xx is the major reason code (positive integer less than 256) yy is the minor reason code (positive integer less than 65536) c:\> c:\> Oh, my mistake. I thought I read somewhere that you had to run shutdown as a program in batch files, because you can't use the shutdown command in batch. But I guess I must've read wrong.Thanks a lot you guys, you've been a mountain of help. Now I just need to know one thing (I know I'm probably getting annoying now) But what would I need to input to tell it OPEN a browser on a certain website?"C:\Program Files\Internet Explorer\IEXPLORE.EXE" "http://www/google.com" Quote from: Millenion on May 29, 2007, 02:09:08 PM Thanks a lot you guys, you've been a mountain of help.you can just do Code: [Select]c:\> start "www.google.com" Actually, you wouldn't need the quotes because all websites are one WORD (they use underscores for spaces). So, Code: [Select]start www.google.com |
|