我有一个Excel文件说Log.xls跟踪他的登录&注销时间。我希望在特定用户登录时以及在他退出时打开它。
我为此找到了解决方案,
写一个.bat文件说OpenLog.bat打开Log.xls
@ECHO OFF
@ECHO "Please Wait, Your log file is about to open... Please Fill Your Work Log..."
@CD E:\Anoop\Documents
@CALL Log.xls
@ECHO "Have a nice time"
运行gpedit.msc
在用户配置下 - > Windows设置 - >打开脚本
将Bat文件名添加到其中。
我希望在Windows XP计算机上为特定用户帐户运行此Log.xls。
答案 0 :(得分:0)
好的,我们假设用户名是“John”
@ECHO OFF
if '%username%' == 'John' goto label1 else exit
label1:
ECHO "Please Wait, Your log file is about to open... Please Fill Your Work Log..."
CD E:\Anoop\Documents
CALL Log.xls
ECHO "Have a nice time"