Computing.Net > Forums > Programming > can we find a file in one folder?

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.

can we find a file in one folder?

Reply to Message Icon

Name: mala_un
Date: July 27, 2006 at 20:19:34 Pacific
OS: Win XP/ Win 98/ FedoraCor
CPU/Ram: Intel/ 512 MB
Product: dell / acer
Comment:

im running win 98
i'm running a batch file

can be find a file inside one folder and copy into one file.

let say..
ask user to enter filename..
check wether the file exist or not in C:\foldername..
if the file exist, copy into one new file..
if not, ask question again..

please help me..
thanks in advance



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: July 28, 2006 at 15:42:02 Pacific
Reply:

Try this:

::== m3.bat
@echo off
if not %1'==' goto :main

echo filename?
goto :eof

:main
if not exist C:\foldername\%1 goto :nofile
copy C:\foldername\%1 newfile
goto :eof

:nofile
echo %1 not found. try again

:eof
:: DONE



If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: mala_un
Date: July 30, 2006 at 22:57:05 Pacific
Reply:

thanks Mechanix2Go..

i'll try this..
and see how...


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Perl search and replace 64-bit integers in C?



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: can we find a file in one folder?

find todays file in one folder usei www.computing.net/answers/programming/find-todays-file-in-one-folder-usei/16404.html

move a file from network in java? www.computing.net/answers/programming/move-a-file-from-network-in-java/4144.html

Find oldest file in folder www.computing.net/answers/programming/find-oldest-file-in-folder/14755.html