我編寫了此腳本以在另一臺計算機上遠程運行文件,但是我想以管理員用戶身份運行該文件,但要在用戶計算機上顯示該文件。如何以管理員身份遠程運行腳本,但要在用戶個人資料中顯示該腳本?以管理員身份運行bat文件但在用戶個人資料中顯示
@echo off
color 0a
SET /p ComputerName=ComputerName:
SET /p UserName=Please enter the username:
SET /p UserNamePassword=Please enter Username Password:
tasklist /s \\%ComputerName% /u %UserName% /p %UserNamePassword% /FI "memusage gt 200000"
SET /p Value=would you like to continue? Press 1 if yes.Press 2 to exit:
IF %Value% EQU 1 pushd \\NetworkPath & copy batfile.bat \\%ComputerName%\c$\Users\%UserName%\Desktop & popd & psexec -i -s -d \\%ComputerName% -u %UserName% -p %UserNamePassword% "C:\Users\%UserName%\Desktop\batfile.bat"
IF %Value% EQU 2 exit