Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a batch script that copies the entire contents of a CDrom to my server and then creates a text file that is a script to import image files into our printing software.
My problem is that these files come from multiple sources and the naming conventions vary.
I need to add capability to my batch file to check filenames for more then 31 characters, and extra characters as in &.!:.$..
Here is the script...echo off
@ECHO This will copy the entire contents of the CDrom to Wip2
@ECHO In the Directory %1_%2
@xcopy d:\ \\server\WIP2\%1_%2\ /E /WH
@ECHO -
@TREE \\server\WIP2\%1_%2 /f /A >\\server\wip2\jobsData\%1_%2.txtIF NOT EXIST C:\commands\%1_%2.txt (GOTO :CreateJob) ELSE ( GOTO :AddImages)
:CreateJob
>>C:\commands\%1_%2.txt echo ^Include: Cmds^;
>>C:\commands\%1_%2.txt echo ^AddOrder(~%1~,~%2~);
:AddImages
for /r \\server\WIP2\%1_%2\ %%K in (*.jpg,*.tif) do >>C:\commands\%1_%2.txt echo ^PutImage(~%1~,~2~,~%%~nxK~,~%%K~)^;
for /r \\server\WIP2\%1_%2\ %%K in (*.jpg,*.tif) do >>C:\commands\%1_%2.txt echo ^getthumnails(~%1~,~2~,~%%~nxK~,~%%K~)^;
pause
exit
The script works perfectly except when we have more then 31 characters and/or extra characters in the filenames.
Any help is appreciated...

![]() |
![]() |
![]() |

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