批处理如何调用管理员权限的PowerShell命令执行语句?
需要封装系统但是在虚拟机执行了以下的语句后,封装系统后发现这几个软件又出现在系统里面,需要用批处理重新执行一下一句get-appxpackage*zunevideo*|r...
需要封装系统 但是在虚拟机执行了以下的语句后,封装系统后发现这几个软件又出现在系统里面,需要用批处理重新执行一下一句
get-appxpackage *zunevideo* | remove-appxpackage
get-appxpackage *zunemusic* | remove-appxpackage
get-appxpackage *photos* | remove-appxpackage 展开
get-appxpackage *zunevideo* | remove-appxpackage
get-appxpackage *zunemusic* | remove-appxpackage
get-appxpackage *photos* | remove-appxpackage 展开
2个回答
展开全部
不清楚你的实际文件/情况,仅以问题中的样例/说明为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI
<# :
cls
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~f0"" rem","","runas",1)(window.close)&exit
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
powershell -NoProfile -ExecutionPolicy bypass "Invoke-Command -ScriptBlock ([ScriptBlock]::Create([IO.File]::ReadAllText('%~f0',[Text.Encoding]::Default)))"
echo;%#% +%$%%$%/%@% %z%
pause
exit
#>
get-appxpackage *zunevideo* | remove-appxpackage
get-appxpackage *zunemusic* | remove-appxpackage
get-appxpackage *photos* | remove-appxpackage
<# :
cls
@echo off
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c ""%~f0"" rem","","runas",1)(window.close)&exit
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
powershell -NoProfile -ExecutionPolicy bypass "Invoke-Command -ScriptBlock ([ScriptBlock]::Create([IO.File]::ReadAllText('%~f0',[Text.Encoding]::Default)))"
echo;%#% +%$%%$%/%@% %z%
pause
exit
#>
get-appxpackage *zunevideo* | remove-appxpackage
get-appxpackage *zunemusic* | remove-appxpackage
get-appxpackage *photos* | remove-appxpackage
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询