how to specify a folder in this example

October 7, 2011 at 14:56:09
Specs: Windows 7 64 bit, Intel I3 / 4G
@echo off & setLocal enableDELAYedeXpansioN
:start
set E=
for /f "tokens=* delims= " %%h in ('dir/b') do (
set /a E+=1
)
set /a F = !random! %% E + 1

set G=
for /f "tokens=* delims= " %%h in ('dir/b') do (
set /a G+=1
if !F! equ !G! (copy /y "%%h" "c:\users\user1\My Documents\VirtualDJ\Sampler\sample3.*")
)
timeout 5
goto start

In the above batch file I would like to copy file from a different folder other than the folder where the batch file is. How would I specify the folder to copy from ?.


See More: how to specify a folder in this example

Report •

#1
October 7, 2011 at 20:01:53
use %1 while initiallising the batch command.

something like this if you batch file name aaa.bat
aaa.bat abc1 abc2
where aaa.bnat will be like this
copy %1 %2 ( Note - %1 =abc1 , %2 =abc2 )


Hope this resolves.

Vishal
http://www.floppytousb.net


Report •
Related Solutions


Ask Question