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.
BAT File Help
Name: MaGoo Date: February 24, 2004 at 11:18:46 Pacific OS: XP Pro CPU/Ram: 768
Comment:
quick help needed in DOS .
-I want to create a bat file that opens up a txt file and reads data in it (data being the names of files). -Then check to see if the file exists in a folder. -If exists copy it to another folder. -If not exists make a new .txt file adding the file name that is missing to it.
eg: name.txt would contain this text in it 1003.gif 1003.jpg 1223.txt
if there is no 1003.gif in c:\folder then add the line from name.txt above to a new .txt file /n else copy file to c:\folder2
Name: dtech10 Date: February 24, 2004 at 16:33:30 Pacific
Reply:
Hi This help. --------------- Main.bat @echo off if exist new.txt del new.txt for /f %%a in (old.txt) do call Checkit.bat %%a --------------- Checkit.bat @echo off if exist \Folder\%1 ( copy Folder\%1 NewFolder\%1 ) else ( echo %1 >> New.txt ) -------------
0
Response Number 2
Name: MaGoo Date: February 25, 2004 at 06:54:33 Pacific
Reply:
Beautiful~!!!!!!!! i love you!!!!!!!!!!!!!!!
0
Response Number 3
Name: dtech10 Date: February 25, 2004 at 07:40:51 Pacific
Reply:
Hi Magoo When's the wedding.
0
Response Number 4
Name: MaGoo Date: February 25, 2004 at 10:25:32 Pacific
Reply:
I will have to trouble you with more problems in the future before asking your hand in marriage
0
Response Number 5
Name: dtech10 Date: February 25, 2004 at 14:05:37 Pacific
Reply:
Hi There's always a catch.
0
Response Number 6
Name: tImmaY Date: February 25, 2004 at 14:15:06 Pacific
Reply:
yea.. thats the sucky part..
but is it possible to have a batch file search the computer for a certain file and then have it copy that file to a different location? i know how to copy a file, just now how to copy a file after searching/finding it.. lol. thanks
0
Response Number 7
Name: dtech10 Date: February 26, 2004 at 02:33:53 Pacific
Reply:
Hi tlmmaY What operating system.
0
Response Number 8
Name: tImmaY Date: February 26, 2004 at 10:25:08 Pacific
Reply:
windows xp pro
0
Response Number 9
Name: dtech10 Date: February 26, 2004 at 13:45:01 Pacific
Reply:
Hi TImmay
Call Copyfile.bat FileName StorePath if you want permanent filename and StorePath change %1 and %2 to that required.
--------------- rem CopyFile.bat @echo off if "%2"=="" ( echo Usage: CopyFile.bat Filename StorePath exit /b ) dir /s /b | find /i "%1" > tmp.txt set /p FilePath=<tmp.txt copy %FilePath% %2 > nul if %errorlevel%==1 ( echo Filename or StorePath not Found! ) else ( echo File copied ok. )
0
Response Number 10
Name: tImmaY Date: February 26, 2004 at 21:08:45 Pacific
Reply:
aight tight.. lol, this may sound like a stupid question, but like whats the %2 & %1 for.. and like, how do i make it work? lol *sry*
0
Response Number 11
Name: tImmaY Date: February 26, 2004 at 21:10:15 Pacific
Reply:
oh.. haha.. wow i'm dumb.. sorry dude, i read the entire post earlier but then i went and hung out with my chic for a while so now when i came back i kinda forgot the first part of that.. lol
0
Response Number 12
Name: dtech10 Date: February 27, 2004 at 07:00:32 Pacific
Reply:
Hi She must be some chic.
0
Response Number 13
Name: tImmaY Date: February 28, 2004 at 21:58:27 Pacific
Summary: I need some help with a bat file that I created. I am trying to make it stay minimized on my user's screens. Do I simply put Echo Off or @Echo Off in the bat file and where do I put it to take effec...
Summary: I want to make a bat file that will delete the Recent History in the My Documents . I have this right now . @ECHO OFF :START DEL "C:\Documents and Settings\add your computer name here \Recent\*.*" @E...
Summary: Please help... OK what this sounds like will be a virus, but none the less all a virus is is a desctructive program right? ok. I am looking for a batch script that when it runs the first time executed...