Skip to content

Commit b74a312

Browse files
committed
notes
1 parent b17606e commit b74a312

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Modules/Scripts/Invoke-NormalUser.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,15 @@ param (
1212
[string] $Command
1313
)
1414

15-
#https://superuser.com/questions/1749696/parameter-is-incorrect-when-using-runas-with-trustlevel-after-windows-11-22h2
15+
<#
16+
https://superuser.com/questions/1749696/parameter-is-incorrect-when-using-runas-with-trustlevel-after-windows-11-22h2
17+
18+
The workaround with /machine:x86|amd64|arm|arm64 works. If you are on a 64bit intel machine and
19+
want to execute a batchfile there is no machine option that will work since cmd.exe is a 64 bit
20+
application. There is a 32bit version for cmd.exe at C:\Windows\sysWOW64\cmd.exe, so a command
21+
could be as follows:
22+
23+
runas /machine:x86 /trustlevel:0x20000 "C:\Windows\sysWOW64\cmd.exe <yourBatchfileHere>"
24+
#>
25+
1626
runas /machine:x86 /trustlevel:0x20000 "C:\Windows\sysWOW64\cmd.exe /c `"$Command`""

0 commit comments

Comments
 (0)