Computing.Net > Forums > Programming > batch file name checking

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

batch file name checking

Reply to Message Icon

Name: jconner
Date: February 8, 2004 at 19:49:04 Pacific
OS: 2000
CPU/Ram: 2.6 1gig
Comment:

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.txt

IF 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...




Sponsored Link
Ads by Google

Response Number 1
Name: jconner
Date: February 17, 2004 at 00:58:13 Pacific
Reply:

Nevermind,
I figured it out...
Thanks,


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file name checking

Batch file for checking filesize www.computing.net/answers/programming/batch-file-for-checking-filesize/15432.html

Batch file to check file attribute www.computing.net/answers/programming/batch-file-to-check-file-attribute-/16175.html

Batch File NAme calling! www.computing.net/answers/programming/batch-file-name-calling/18310.html