The workaround is
to enclose the filename in quotation marks.
Say you wish to rename a file named my stuff.txt to her stuff.doc. Instinctively,
you might type:
ren my stuff.txt her stuff.doc
However, this won??™t work, since the ren command sees only that you??™ve
typed four parameters: my, stuff.txt, her, and stuff.doc. Instead, you??™ll need
to use quotation marks, like this:
ren "my stuff.txt" "her stuff.doc"
Now, this isn??™t always the case. For example, say you want to use the cd command
to change the current working directory to Program Files, like this:
cd Program Files
Here, the Command Prompt is smart enough to interpret this correctly, and
no quotation marks are needed.
Tip for you lazy types: you can often leave off the final quote, and it??™ll still work.
Command Prompt Scripting | 557
Scripting and
Automation
can be a tremendous time saver if you find yourself entering the same commands
repeatedly.
When you run a batch file, each command in the file will be
displayed (echoed) on the screen before it??™s executed, which
can be unsightly for the more compulsive among us. To turn
off the echoing of any given command, precede it with the @
character. To turn off the printing of all commands in a
batch file, place the command @echo off at the beginning of
the batch file.
To run a batch file, double-click its icon in Explorer or, if it??™s in the current
working directory (folder), you can type its name at the Command Prompt.
Pages:
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776