新足迹

 找回密码
 注册

精华好帖回顾

· 更新:跳槽。在家十年,重回职场。 (2021-8-18) zhangxiaoli · 也谈我对蒙式教育的初浅了解,希望对大家有用。 (2009-5-27) snowbird
· 【魔头推荐】脱发?!产后脱发? ! 有救的!! 换换你的洗发水吧!---AVEDA+SWISSE+ReEn润膏 (2015-5-29) 魔头 · 结束了买不到房子的痛苦生活(全文完毕) (2007-8-15) toto315
Advertisement
Advertisement
查看: 749|回复: 1

[IT] 请教高手帮我把以下的批处理文件改成vbscript文件 [复制链接]

发表于 2009-11-13 15:15 |显示全部楼层
此文章由 caliven 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 caliven 所有!转贴必须注明作者、出处和本声明,并保持内容完整
@echo off
@echo register BootUp action
call "C:\WINDOWS\system32\GroupPolicy\Logger.bat" /STARTUP
rem exit
只需要改上边的文件就好,下边的只是参考
华丽的分割线
==================================================================
logger.bat的文件内容是
@echo off
cls

Rem Use IPConfig /all command to list and find the last IP address from the list
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "IP Address"') DO FOR %%B IN (%%A) DO SET IPADDR=%%B

Rem Use IPConfig /all command to list and find the MAC ADDRESS
FOR /F "TOKENS=2* DELIMS=:" %%A IN ('IPCONFIG /ALL ^| FIND "Physical Address"') DO FOR %%B IN (%%A) DO SET MACaddress=%%B

if %1==/LOGON GOTO LogonRecord
if %1==/LOGOFF GOTO LogoffRecord
if %1==/STARTUP GOTO StartupRecord
if %1==/SHUTDOWN GOTO ShutdownRecord

: LogonRecord
set Line=%Date% %Time% LOG ON %Username% on %ComputerName% %IPAddr% %MACaddress%
echo %Line% >> c:\WINDOWS\system32\GroupPolicy\Log-%ComputerName%.txt
goto FINISH

: LogoffRecord
set Line=%Date% %Time% LOG OFF %Username% on %ComputerName% %IPAddr% %MACaddress%
echo %Line% >> c:\WINDOWS\system32\GroupPolicy\Log-%ComputerName%.txt
goto FINISH

: StartupRecord
set Line=%Date% %Time% STARTUP %ComputerName% %IPAddr% %MACaddress%
echo %Line% >> c:\WINDOWS\system32\GroupPolicy\Log-%ComputerName%.txt
goto FINISH

: ShutdownRecord
set Line=%Date% %Time% SHUTDOWN %ComputerName% %IPAddr% %MACaddress%
echo %Line% >> c:\WINDOWS\system32\GroupPolicy\Log-%ComputerName%.txt
goto FINISH


: FINISH
::net use U: \\Imaxime2\UtzonScripts
::echo \\Imaxime3\NetLog\NetworkLog LN %ComputerName% %UserName%

小弟不胜感激
Advertisement
Advertisement

发表于 2009-11-13 21:07 |显示全部楼层
此文章由 caliven 原创或转贴,不代表本站立场和观点,版权归 oursteps.com.au 和作者 caliven 所有!转贴必须注明作者、出处和本声明,并保持内容完整
没人哦

发表回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Advertisement
Advertisement
返回顶部