VB Script ,Shell Scripting ,Windows Batch Scripting

Hi experts

I have about 300 folders, inside each folder has few mix files exe / pdf/ and some file with name BUT NO EXTENSiON . I want to rename those files without NO EXTENSION to doc file
is there batch file can do this task
thanks in advance

this is what did on mine batch but it seemed not working
@ECHO OFF
PUSHD .
FOR /R %%d IN (.) DO (
cd "%%d"
IF EXIST *.* (
REN *.* *.jpg
)
)
POPD



Your code and the description are not fitting together that much, but from what I read:



Your code and the description are not fitting together that much, but from what I read:



That Qlemo too quick again! Aside from the fact I was about to use %%a the same... you should be good to go except I think you will also need "tokens=*" in case of filenames or dirs with spaces in:



hi Steve

your code is working , can i ask you why it tried ran through C drive.

for instance the folderfiles is on c:new . is there a way when run your bat it just go to c:new and that's it. i saw it running through program files/windows, look like complete c drive
secondly, there showing something file too long name so if my files has too long name, will it work?
many thanks in advance



It should work down from the current directory, you can change to that first, or use the line cd /d "c:new" to move there first.

Alternatively you can add the path as part of the dir, i.e.



steve

cd /d "c:start dir" ? do i need to change it to cd /d "c:new dir"

because the folder is on c:new

thanks in advance

Share this

Related Posts

There was an error in this gadget