View unanswered posts | View active topics It is currently 19 Dec 2014 09:08



Post new topic Reply to topic  [ 4 posts ] 
Batch files to convert files 
Author Message

Joined: 22 Dec 2010 12:53
Posts: 28
Post Batch files to convert files
I didnt know where to put this so i made this topic.
You con download some picture converters(jpeg/gif/png/bmp).
I know there very basic im only new to the world of batch files.
http://www.megaupload.com/?d=XU3LK700


22 Dec 2010 13:19
Profile

Joined: 06 Jul 2009 16:19
Posts: 78
Location: Lisbon, Portugal
Post Re: Batch files to convert files
looll this is not converting it's just renaming but i explane you the code.
Code:
@echo off
title Bmp Converter
goto Start

:Start
SET INPUT=
ECHO.
ECHO Make a choice...[lower case]
ECHO.
ECHO converts BMP files only
ECHO.
ECHO GIF = Convert to *.Gif
ECHO PNG = Convert to *.Png
echo JPG = Convert to *.Jpg
ECHO.
SET /P INPUT=gif/png/jpg:
if "%input%" =="" GOTO Start
if "%input%" =="gif" GOTO gif
if "%input%" =="png" GOTO png
if "%input%" =="jpg" GOTO jpg

:gif
ECHO Converting
rename *.bmp *.gif
ECHO progress 100%
ECHO done
PAUSE
exit

:png
ECHO Converting
rename *.bmp *.png
ECHO progress 100%
ECHO done
PAUSE
exit

:jpg
ECHO Converting
rename *.bmp *.jpg
ECHO progress 100%
ECHO done
PAUSE
exit


Echo is a command that makes appears output text (ex: Echo Hey - output Hey)
rename it's a command that changes the name of the files or their extension but it for changing extension works very bad.
goto it's a command that is used with the :, ( example you put goto p and lines above you put :p, and when you open your batch file that go to the part of the code where is the :p)
Pause it's just for pause the code but if you press any button it will go on
set /p it's a code that defines variables (example you put set /p k= hey and later you put echo %k% it will say hey)
exit it's to leave batch program
if it's a command to compare variables ex if %l%=="5" goto x

Regards, rfpd


22 Dec 2010 16:55
Profile WWW

Joined: 22 Dec 2010 12:53
Posts: 28
Post Re: Batch files to convert files
hey i all i did was download a .bat file that "renames" files and changed it a
little bit.ok.


30 Dec 2010 09:21
Profile
Expert

Joined: 22 Jan 2010 18:01
Posts: 1807
Location: Germany
Post Re: Batch files to convert files
Changing the extension of a file has absolutely nothing to do with converting. It doesn't affect the contents of the file itself. The only reason why you can open the renamed files at all is that your Picture Viewer/Editor is "intelligent" enough to observe this deception.

Regards
aGerman (BatTrainee :wink: ).


30 Dec 2010 09:54
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: dieluna, Google [Bot], Yahoo [Bot] and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Forum style by Vjacheslav Trushkin for Free Forums/DivisionCore.