/f 批处理文件的帮助
这是我的代码:
start /realtime /b /wait .\jampDed.exe
for /f "tokens=1-5 delims=:" %%d in ("%time%") do rename .\CIA_Secure_Host2\qconsole.log %%d-%%e-%%f
start .\Serv.bat
cmd
这个批处理应该在窗口中运行程序,当它退出时,应该将文件 qconsole.log 重命名为当前时间,然后重新启动批处理文件(Serv.bat)。
问题是,在我运行批处理文件后,如果我尝试再次运行它,它不会重命名该文件,给我一个错误,说它无法访问该进程,因为它正在使用中。如果我想编辑批处理文件并在之前运行它后保存它,我也会得到同样的错误。
heres my code:
start /realtime /b /wait .\jampDed.exe
for /f "tokens=1-5 delims=:" %%d in ("%time%") do rename .\CIA_Secure_Host2\qconsole.log %%d-%%e-%%f
start .\Serv.bat
cmd
this batch is supposed to run the program in a window, and when it quits, is supposed to rename the file qconsole.log to the current time, and then relaunch the batch file (Serv.bat).
problem is, after i run the batch file, if i try to run it again, it wont rename the file, giving me an error saying that it could not access the process because it is in use. i also get the same error if i ty to edit the batch file and save over it after previously running it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的目的是运行
jampDed
,然后重命名其日志文件,并在无限循环中执行此操作,为什么不直接使用:而不是摆弄运行命令文件的递归副本。
If your intent is to run
jampDed
, then rename its log file, and do that in an infinite loop, why not just use:instead of fiddling around with running recursive copies of the command file.