for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do start
/wait z:\"%%a"
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do
move z:\"%%a" z:\%dt%
望高手解答,谢谢!
呵呵,谢谢了,代码我修改了下
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
if exist z:\ goto run
:映射
net use Z: /delete /yes
net use Z: \\192.168.0.11\d$\fax /yes "cmpadmin" /user:cmpadmin
if not exist z:\ goto 映射
:run
for /f "tokens=1,2,3* delims=- " %%a in ('date /t') do set dt=%%a-%%b-%%c
if not exist z:\%dt% md z:\%dt%
if not exist z:\*.txt goto time
mshta vbscript:createobject("sapi.spvoice").speak("fax comming")(window.close)
mshta vbscript:msgbox("传真来了!",64,"提示")(window.close)
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do (
for %%a in (%%e) do (
start /wait z:\"%%a"
move z:\"%%a" z:\%dt%
)
)
:time
ping 127.0.1 /n 10>nul
goto begin
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do start /wait z:\"%%a"
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do move z:\"%%a" z:\%dt%
这两句中我都取了%%e作为变量,我只想要把两句合成一句剩去for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) 这句话
老大帮忙看看,谢谢!
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do start /wait z:\"%%a"
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do move z:\"%%a" z:\%dt%
这两句我想合并为
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do start /wait z:\"%%a" do move z:\"%%a" z:\%dt%
但是执行不了
我是做了个检测文件夹变化的批处理
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("""%~nx0"" h",0)(window.close)&&exit
:begin
if exist z:\ goto run
:映射
net use Z: /delete /yes
net use Z: \\192.168.0.11\d$\fax /yes "cmpadmin" /user:cmpadmin
if not exist z:\ goto 映射
:run
for /f "tokens=1,2,3* delims=- " %%a in ('date /t') do set dt=%%a-%%b-%%c
if not exist z:\%dt% md z:\%dt%
if not exist z:\*.txt goto time
mshta vbscript:createobject("sapi.spvoice").speak("fax comming")(window.close)
mshta vbscript:msgbox("传真来了!",64,"提示")(window.close)
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do start /wait z:\"%%a"
for /f "tokens=1,2,3,4,5" %%a in ('dir z:\*.txt^|find "%dt%"') do for %%a in (%%e) do move z:\"%%a" z:\%dt%
:time
ping 127.0.1 /n 10>nul
goto begin