Share via

ShellRunAs issue

Alessio 0 Reputation points
2026-03-13T15:36:52.53+00:00

I am trying to use ShellRunAs to run some executables such as:

shellRunAs.exe /netonly c:\windows\system32\serverManager.exe

but it complains saying that "the system cannot find the file specified" but file is there, in the correct path, so I don't understand what could be the issue. This happens also randomly with other exe, such as "RSTRUI.EXE" , "RECDISC.EXE" and others.

Also, I noticed that if I am creating a shortcut to an application and edit its Target property to run, e.g.,

shellRunAs.exe /netonly c:\windows\system32\dsa.msc /domain=myDomain.fqdn

it does ignore all whatever is after the first command.

Thanks

alessio

Sysinternals
Sysinternals

Advanced system utilities to manage, troubleshoot, and diagnose Windows and Linux systems and applications.

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-13T15:37:05.1633333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    ShellRunas expects the target program path and its arguments to be passed in a way that lets it correctly separate the executable from its parameters. The issues described are consistent with:

    1. Incorrect parsing of the target path and arguments
    2. Using ShellRunas in a way that does not match its documented syntax

    From the documentation, the correct usage is:

    shellrunas [/netonly] <program> [arguments]
    

    So for the examples:

    1. Server Manager

    Use:

    shellrunas.exe /netonly "C:\Windows\System32\ServerManager.exe"
    

    If the path contains spaces or if the shell is mis-parsing the command, quoting the full path to the executable is required. Without correct quoting, ShellRunas may treat part of the path as arguments, fail to locate the executable, and return “The system cannot find the file specified.”

    1. RSTRUI.EXE, RECDISC.EXE, and similar tools

    Use the same pattern:

    shellrunas.exe /netonly "C:\Windows\System32\rstrui.exe"
    

    If these are 32‑bit vs 64‑bit redirection cases (on 64‑bit Windows), ensure the path is correct for the process bitness being used.

    1. Using ShellRunas in a shortcut (with arguments after the target)

    ShellRunas only treats the first non-switch token after its own switches as the <program> and everything after that as arguments to that program. For:

    shellrunas.exe /netonly c:\windows\system32\dsa.msc /domain=myDomain.fqdn
    

    ShellRunas is being asked to run dsa.msc directly, which is not an executable. .msc files must be opened by mmc.exe. The correct form is:

    shellrunas.exe /netonly "C:\Windows\System32\mmc.exe" "C:\Windows\System32\dsa.msc" /domain=myDomain.fqdn
    

    Key points to avoid the “file not found” and argument‑ignored behavior:

    • Always pass an actual executable as <program> (e.g., mmc.exe, not .msc directly).
    • Quote any path that contains spaces.
    • Place all arguments after the <program>; ShellRunas forwards them to that program.
    • For .msc consoles, explicitly call mmc.exe and pass the .msc as the first argument.

    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.