【发布时间】:2020-11-12 02:45:12
【问题描述】:
这是我第一次尝试使用 .bat 文件。我正在尝试制作一个将我的 Access 数据库前端保持在最新版本的用户(仅 ~7)。
我正在使用:
md C:\Users\tmyers\Desktop
del C:\Users\tmyers\Desktop\Quotations.accdr
copy "\Users\counter1152\desktop\PM DESKTOP FILES\Lighting Project Management Application\Quotations.accdr" C:\Users\tmyers\Desktop
C:\Users\tmyers\Desktop\Quotations.accdr
我删除了部分复制字符串,因为它是我们服务器的路径(以防万一)。我需要用户根据执行文件的人以某种方式动态。我可以为每个人制作一个特殊的 .bat 文件,因为我没有很多用户,但这似乎很草率。
作为第二个问题,我怎样才能让 cmd 提示窗口在执行时不显示?那只是我的个人喜好。我确实找到了https://superuser.com/questions/140047/how-to-run-a-batch-file-without-launching-a-command-window 以供参考,但我不是 100% 确定如何执行 wscript。
【问题讨论】:
-
使用 %userprofile%
-
只是为了确定,所以在这种情况下我会用那个替换我的名字(tmyers)?
标签: ms-access batch-file