更改批处理文件中随机选择的文件的“已修改”时间戳? WIN7

时间:2014-04-16 07:35:28

标签: batch-file random

嘿,所有我一直在创建一个.bat文件来随机选择一个文件,在这种情况下.jpg文件,然后被移动到它们将在电视上显示的位置。

电视从随机拍摄的照片中抓取最新图像。

我的问题是如何将“thouch”与现有的代码进行互操作?

@echo off
:LOOP
setlocal EnableDelayedExpansion
cd C:\Users\bruce\Desktop\Test
set n=0
for %%f in (*.*) do (
   set /A n+=1
   set "file[!n!]=%%f"
)
set /A "rand=(n*%random%)/32768+1"
copy "!file[%rand%]!" \\server\TV\NoticeBoard
timeout /t 50
goto :LOOP

1 个答案:

答案 0 :(得分:0)

....
copy /b "!file[%rand%]!"+,,
copy "!file[%rand%]!" \\server\TV\NoticeBoard
....