anytojpg,btm

  • Thread starter CSGalloway@nc.rr.com
  • Start date
C

CSGalloway@nc.rr.com

Guest
Take Command 8.02.106 Windows XP [Version 5.1.2600]
Take Command Build 106 Windows XP Build 2600 Service Pack 3
Registered to Charles S. Galloway - 5 System License

I had two questions about the BTM below. One is there any way to make it
simplier or quicker? And thne I am getting:

TCMD: (Sys) C:\BATCH\anytojpg.btm [59] The system cannot find the file
specified. ""
TCMD: (Sys) C:\BATCH\anytojpg.btm [59] The filename, directory name, or
volume label syntax is incorrect. "C:\ALLFLDRS\_001\
i think it's because I have some off named files .... so it's the SETDOS /X
value? the filenames that have chars other than A-Z and 0-9 are:

(1)Untitled01
(2)Untitled01
(3)Untitled01
)
-)
00e701c6b6ba$c597ccb0$4101a8c0@DESKTOP
00e901c6b6ba$c597ccb0$4101a8c0@DESKTOP
00eb01c6b6ba$c597ccb0$4101a8c0@DESKTOP
4&w=192&r=2008-05-05T202413Z_01_N05401629_RTRUKOP_0_PICTURE0
=COLUMNISTS0106&ArtNo=604060328&Ref=AR&Profile=1061&MaxW=315
=iso-8859-9BQef9ayBH9mt5Hr8IEFya2FwbGFuLmpwZw===iso-8859-9BQf5rW79IFP2eWxlLm1wMw===iso-8859-9BREQVU0gR9xO3C56aXA==iso-8859-9BRWRhIE1ldGluINZ6GxrCBEbB1bSBHG78bS0ubXAz=iso-8859-9BTUVUUk8gLSBTT04gR91E3d7dTS5tcDM==iso-8859-9Ba2FyXP9ay56aXA==iso-8859-9Bc2FyXP9bi56aXA=AlyssaSutherland-Black+White-04
AlyssaSutherland-Black+White-11
BARTH'S
FWFwdHolidayFunniesThatareJustOfftheBeatenPath!]
I'SYPORN
Sean_Grey's
TOO)
Y'SY'TO
Y(NOYS~1
YBRITN~1
YBRITN~2
YBRITN~3
Y_BRIT~1
[[BRITNE
untitled-[2]
{2A5A8284-8B23-4
·_·~1

================================================setlocal
unalias *
goto start
TEXT
Goes thru globaly (in a user specifed home folder or the CWD
and for each .JPG or .JPEG file reads the first 2 characters
of each and if is "JG" then renames to a .ART extension and
only output is the RENaming of the file or an app. error
message if a .ART file already exists.
ENDTEXT
::
:: next 2 lines handles drive/folder change with %1
:: calling syntax: AnyToJpg.btm C:\DOWN\Temp
::
:start
CLS
set fn=start

setdos /x-4

set cOutfile=D:\AnyToJpg.btm
if exist %cOutfile del /q /w %cOutfile

>%cOutfile
iff %# eq 0 then
set sFold=%_CWD
else
set sFold=%1
endiff
pushd %@instr[0,2,%@full[%sFold]]
pushd %sFold
set nART=0
set nBMP=0
set nGIF=0
set nJPG=0
global /I gosub F_RENAME
echo %nART ART Files
echo %nBMP BMP Files
echo %nGIF GIF Files
echo %nJPG JPG Files
unset /q uNum
popd
popd
SETDOS /X+4
quit

:F_RENAME
do cname IN ( * )
set jp=%@fileopen["%cname",read,b]
iff %jp == -1 then
echoerr *** (%fn) is before errored File.
echo *** (%fn) is before errored File. >> %cOutfile
echo *** error opening (%_cwds%%cname) >> %cOutfile
iterate
endiff
set fn=%_cwds%%cname
set tst=%@fileread[%jp,16]
set dummy=%@fileclose[%jp]
set nm=%@full[%jp]
iff "%@instr[6,4,%tst]" == "JFIF" then
iff %@ext["%_cwds%%cname"] == "JPG" then
echo ""%_cwds%%cname" >> %cOutfile
else
:JPEG
echo ren "%cname" "%@name[%cname].JPG" >> %cOutfile
endiff
elseiff "%@left[2,%tst]" == "JG" then
:ART
echo ren "%cname" "%@name[%cname].art" >> %cOutfile
set nART=%@inc[%nART]
elseiff "%@left[3,%tst]" == "GIF" then
:GIF
echo ren "%cname" "%@name[%cname].GIF" >> %cOutfile
set nGIF=%@inc[%nGIF]
elseiff "%@left[2,%tst]" == "BM" then
:BMP
echo ren "%cname" "%@name[%cname].BMP" >> %cOutfile
set nBMP=%@inc[%nBMP]
else
rem echo *** unknown (%@instr[7,4,%tst]) (%_cwds%%cname)
endiff
unset /q fn, txt, dummy, nm
enddo
return
================================================
 
Similar threads
Thread starter Title Forum Replies Date
vefatica Console not redrawn in BTM or with multiple commands Support 4
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
Charles S. Roaten Problems with TCSTART.BTM Support 1
P Kill all other instances of tcc from a btm batch file Support 2
C TCC 26 BATCOMP BTM problems? Support 5
B IF command problem in tcexit.btm Support 9
vefatica WAD DIR.BTM? Support 11
vefatica BTM, elevated, console window caption? Support 4
I BTM slower than BAT? Support 14
D btm file command line augments comparing for string or math. Support 12
D check for network tcstart.btm and load if newer Support 3
Craig Fitzgerald Problems using tcstart.btm Support 3
vefatica Installer sets BTM associations wrongly Support 4
O I cannot use links to .btm files Support 5
CWBillow Can't right-click a BTM Support 7
C NE1 have BTM to remove %appdata\JP Software\ etc... Support 0
C interesting TCStarts.btm Support 2
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
Paul Berwanger BTM Bugs Support 2
M Drag and Drop for .BTM scripts Support 10
D WAD START /ELEVATED "Title" /PGM "job.btm" Support 6
C How to? run a BTM in elevated, inv tcc tab window Support 9
Roedy How to? Understanding BTM file properties Support 0
Fross GetOpt.btm Support 0
Roedy BTM file encoding Support 13
C How to? Add date/time to custom tpipe based BTM Support 1
thedave Problem chaining piped FIND commands in BTM Support 7
P Concatenating strings in a BTM Support 3
C Cmpr_Del.btm need help understanding UDF..... Support 2
R Unable to start any BTM file from Explorer Support 5
G .BTM association doesn't work anymore Support 1
A 18.00.21 tries to cancel TCSTART.BTM Support 3
B How to? why does my BTM stop Support 2
redwdc btm won't run in ver. 17 but works in ver. 16 Support 11
I How to? Bat Works but BTM Doesn't Support 6
C Documentation .CMD .BAT .BTM Support 15
C TCMD17x64\tcchere.btm Support 3
T How to? sort history in tcexit.btm Support 22
Mezlo help with btm fragment Support 9
C REQ: tcmdhere.btm mod Support 11
vefatica Why isn't TCSTART.BTM run? Support 8
vefatica BTM file hoses logon session Support 12
C move_all.btm Support 34
J Passing % character through command line to .btm Support 5
C @CharlesDye - RegTweaks.btm n/w Support 11
C z_newmove.btm questions Support 6
R Drag to BTM no longer works in Windows 8.1 Support 10
T Associating BTM files with IDE results in DOS box Support 33
MickeyF Why does my tcstart.btm sometimes terminate tcc.exe? Support 4
Mordachai How to get a TC interface instead of a console for .btm, .bat, ? Support 10

Similar threads