永发信息网

请教高手帮我把以下的批处理文件改成vbscript文件

答案:1  悬赏:40  手机版
解决时间 2021-07-21 07:30
  • 提问者网友:疯子也有疯子的情调
  • 2021-07-21 03:15
请教高手帮我把以下的批处理文件改成vbscript文件
@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
最佳答案
  • 五星知识达人网友:上分大魔王
  • 2021-07-21 04:25

Set WS=WScript.CreateObject("WScript.Shell")


WS.Run ""+chr(34)+"C:\WINDOWS\system32\GroupPolicy\Logger.bat"+chr(34)+" /STARTUP",0

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯