Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi
I am trying to create a program to do the following
Search a drive for files of a certain type and the pass the file name on to batch file so a vbs script can be execued on them, I have tried this with for file sbut it keeps crashing with recursive folder errors. Does anyone know why this would happen or another way of doing it.
Thanks
Forfiles
echo on
FORFILES -pC:\ -s -v -m*.ppt -c"CMD /c c:\allinonebat.bat @FILE, @PATH, @FSIZE"Batch file
IF %ERRORLEVEL% NEQ 0 goto end
IF %3 LEQ 10000000 goto end
echo %2\%1 >> "c:\filename.txt"
move %2\%1 g:\IT_TempStorage\Powerpointtestfiles\%1
copy g:\IT_TempStorage\Powerpointtestfiles\%1 c:\temp\657465834639.ppt
IF %ERRORLEVEL% NEQ 0 goto end
cd c:\
cscript c:\final.vbs c:\temp\657465834639.ppt %2\%1
del c:\temp\657465834639.ppt /F
:end

Try something like this:
(You have to save the code into a .bat file)::CODE
@echo off
setLocal EnableDelayedExpansion
for /f "tokens=* delims= " %%A in ('dir /b /s *.ppt') do (
cscript c:\final.vbs "%%A"
)
::ENDCODEOr you can make a list of all .ppt files and save it to a txt file which your vb script could load
@echo off
dir /b /s *.ppt >pptfilelist.txt

Hi
The first one would seem ideal, however when i run the batch file I get an erroraya A not expected at this point?
Cheers
thanks

![]() |
Populating a combo box vb...
|
Batch not copying directo...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |