Re: How to STOP file - what is a command line & script?

From: David Candy (.)
Date: 12/11/04


Date: Sat, 11 Dec 2004 11:15:59 +1100

That batch is for a very specific problem. It can be as simple as

ren oldfilename newfilename

Or as you seem to be adding words to the beginning of a name.

FOR %A IN (*.jpg) do ren "%A" "Old %~nxA"

All jpgs will have old prepended to their name.

-- 
----------------------------------------------------------
http://www.uscricket.com
"~ FreeSpirit ~" <spammenot@nospam.net> wrote in message news:u01ZLUx3EHA.1292@TK2MSFTNGP10.phx.gbl...
> 
> "Malke" <malke@nospoonnotreally.com> wrote in message 
> news:O2E6tyu3EHA.1188@tk2msftngp13.phx.gbl...
> 
>> I gave you an answer to one of your other posts (and please keep posts
>> about one subject in one thread;
> 
> ## Sorry.  The other thread is about WMP and how to stop it from phoning 
> home/being seen as SPYWARE.  I still can't find those buttons the face it 
> shows when it comes up.   But THAT'S another problem.
> 
> it makes it difficult to help you
>> otherwise). However, in addition to what I suggested there, you could
>> also do some Googling about the command line and creating scripts.
> 
> ##  I have no clue what a command line or a script is, what they do or how 
> to write them??!?!?!!  I'm a PC user, not a software, java or script writer. 
> :-)
> 
> For
>> instance, I found this link that might be quite helpful:
> 
>> http://www.computing.net/dos/wwwboard/forum/13970.html
>> It's about renaming files using a batch script.
> 
> From the above site:  I have never seen anything like this nor do I know how 
> to rewrite it allowing me to change names individually in a folder.
> 
> This is the script that was given:  (Example)
> @echo off
> if "%1"=="GoTo" goto %2
> if not "%OS%"=="Windows_NT" goto eof
> %comspec% /v:on /c %0 GoTo start
> goto eof
> 
> :start
> echo.
> echo This program will rename all files from the current directory,
> echo and possibly from its subdirectories, following a certain rule.
> echo.
> echo Press any key to VIEW the renaming process . . .
> pause > nul
> echo Processing . . .
> 
> type nul> %temp%.\process.bat
> :: To include the files under subdirectories from current
> :: directory on the renaming process, add the string ' /R'
> :: after the string 'for' on the next line, so it becomes
> :: 'for /R' (don't forget the space between the strings)
> for %%F in (*.*) do (
> set ORIG=%%~nF
> set ORIG=!ORIG:-=!
> set FILE=!ORIG:~3,-4!
> set EXT=!ORIG:~-4,-1!
> if not "!FILE!"=="" if not "!EXT!"=="" (
> echo REN "%%F" "!FILE!.!EXT!">> %temp%.\process.bat
> )
> )
> 
> ##  And the average PC user is supposed to understand that, where to put it, 
> how to get it to work, how to rewrite it to suit their needs, etc?   It 
> looks like Chinese to me.  :-(
> Besides I'm not just changing or removing one word or number in the file 
> name. I'm adding different years to different files, shortening the Artists 
> names etc.  They can't be batchfiled even if I understood the code above.
> 
> But I thank you for the suggestions.
> 
> FS~
> 
>> Malke
>> -- 
>> MS MVP - Windows Shell/User
>> Elephant Boy Computers
>> www.elephantboycomputers.com
>> "Don't Panic!" 
>

Loading