The idea is fundamentally flawed, and cannot be salvaged.
To start with the first problem: plugging in an USB "stick" (mass storage device) in a computer will cause that computer to configure its USB and file systems drivers in order to access any files stored on that USB stick. If the system is infected, this process may already modify those files - either physically on disk, or when loading them into RAM.
So even if your CMD.EXE
was correct on USB stick, you can't count on it staying that way or being loaded correctly.
The next problem, assuming CMD.EXE
loads correctly, is that it needs to execute. The Win32 process will have several system DLL's loaded. Those could be infected as well. You can't override this by providing your "own" alternative DLL's. This is in fact a security mechanism, because this protects you against loading alternative infected DLL's and getting infected. Of course, in your scenario the system is already infected.
But even if your CMD.EXE loads, even if the system DLL's are unaffected, the process gets a limited view of the PC on which it's running. You cannot know anymore whether you are truly running as Administrator with full overview, all such assumptions are flawed once the system is compromised.
cmd.exe
if you don't have access to Windows?