Solved program that copy from one folder to another every 15sec.

October 28, 2012 at 05:43:15
Specs: Windows 7
hi i need a program or .bat file that copy a .wav file from folder 1 to folder 0 then after 15 secs. copy another file from folder 2 to folder 0 that overwrite the existing file. thanks.

i need a software that interchange every 15seconds the wav file it's playing. thanks you so much for any help i could get.

See More: program that copy from one folder to another every 15sec.

Report •

October 28, 2012 at 06:29:47
✔ Best Answer
@echo off
title ==Home Made==
echo Enter the name of the wav file with .wav extension
set /p uihfu=
copy c:\1\%uihfu% c:\0 /Y
ping -n ^16>nul
copy c:\2\*.* c:\0 /Y
goto a

I made this very quickly cause im in a kind of hurry to go launch , but i could not leave this questions to answer

i set in the above code the folders as if they are in c:\ Change it if you need

If the file in the folder 2 have the same name as the first wav replace this line
copy c:\2\*.* c:\0 /Y
copy c:\2\%uihfu% c:\0 /Y

If this is not what you need say what is wrong that i fix it

Report •

October 28, 2012 at 12:42:50
Quite some time ago, I found what i consider an excellent tool for sound, called AB.EXE (Audio Browser, by John Ball, Dec. 6 1996) which can play wave and midi files from the commandline. (Actually, it will play any file! If you want some amusement, you can:
ab *.*
and listen to your binaries play over the speakers). It still manages to function in win-xp environment, and it can play files back-to-back (ab *.wav). So, with that said, I made this experiment, similar to Roger's code above, but incorporating ab.exe to handle the actual play:
::===== begin script
@echo off & setlocal
start /min ab *.wav
for /f %%a in ('dir /b ..\*.wav') do (
copy /y ..\%%a .\al1.wav
ping -n 1 -w 15000
::======= end script
My test was designed to run in a directory subbed off of the main sound-files directory, so change the code to suit your needs/preferences. It will, however, fail if any of the wav files are less than 15 seconds long, but they can be any size larger than that. I left the ping output active for testing. To suppress it, send it out to nul:
ping... >nul
followup, I tried google to search and had no luck finding it online. :-( The only AB.exe I found was an apache server application of some sort. If you want a copy of mine, I will post it up for you in online storage service, or email it as an attachment, whichever you prefer.

Report •

October 28, 2012 at 17:14:34
hi thanks for fast reply. saw your answer and they where great. btw i tried also to made a script based from the lines you used.

@echo off


echo Changing File now release01

copy D:\wav\release01.wav D:\wav\release.wav
echo Next check in 25 seconds...
echo $
echo $
sleep 25

echo Changing File now release02
copy D:\wav\wav02\release.wav D:\wav\release.wav
echo Next check in 25 seconds...
echo $
echo $
sleep 25

echo Changing File now release03
copy D:\wav\wav03\release.wav D:\wav\release.wav
echo Next check in 25 seconds...
echo $
echo $
sleep 25

echo Changing File now release04
copy D:\wav\wav04\release.wav D:\wav\release.wav
echo Next check in 25 seconds...
echo $
echo $

sleep 25



please tell me what need to do in here if you find any problem. the only thing that make me worried about this code is. if the script is changing the file and the autoplay that fetch the file run at the same time does it generate errors? thanks a lot.

Report •

Related Solutions

October 28, 2012 at 18:32:21
Most apps will lock the file while using it (or Windows will lock it) from being written over, renamed or deleted, but I can't answer your question directly because a) i don't know what app you're using to play the wavs, and b) I probably don't have a copy of it unless it's "standard issue". Aside from that, your code should work as I see it. (Oh, except you probably need "copy /y" to avoid the over-write query for existing files).

Report •

October 29, 2012 at 03:23:42
@nbrane thanks for your reply. Ill use the copy /y. I got question. If i put timeout instead of sleep how can i trigger the press any key and the only trigger is left click of a mouse. Is that possible or should i use autohotkey software instead? Tnx

Report •

October 29, 2012 at 11:26:01
I'm confused by your question. What do you mean by "timeout" (as opposed to "sleep"), and I'm unclear about the key thing/left-mouse thing. Choice.exe will accept a key (no Car.Ret needed), but not a mouse-click (that I know of). You can get choice.exe (or will also do) off an old (pre-xp windows or dos) system, or download it for free. Choice.exe also includes a "timeout" feature which is very handy.

Report •

October 29, 2012 at 20:05:36
Yeah instead of sleep command im gonna use timeout and the trigger for the press any key for timeout is a left click fron a mouse. Thanks you so much for the help i already made a workaround with my problem by using autohotkey. Used autohotkey as a trigger to call the .bat in minimized window and close after the set of commands is accomplised. Thank you so much for the help. This site is have a lot of helpful people. Thanks.

Report •

October 30, 2012 at 04:20:18
Glad for helping you


Report •

Ask Question