Page 1 of 1

What external files are needed to run cmd

Posted: 03 Oct 2016 06:27
by batchcc
So if I take a copy of cmd.exe and put it in another folder it doesn't run perfectly what files are needed for it to work and run default commands (no extra downloads)?

Re: What external files are needed to run cmd

Posted: 03 Oct 2016 06:35
by penpen
What do you mean with "it doesn't run perfectly"?
Where do you copy it to (same hdd/ same pc/...)?
Do you use a custom environment variable set (for example another "path" value)?
(You should mention each difference.)

penpen

Re: What external files are needed to run cmd

Posted: 03 Oct 2016 06:55
by batchcc
penpen wrote:What do you mean with "it doesn't run perfectly"?
Where do you copy it to (same hdd/ same pc/...)?
Do you use a custom environment variable set (for example another "path" value)?
(You should mention each difference.)

penpen

By perfectly I mean if I went onto the forum and copied any random script that already worked on that pc it would still work in that folder if cmd.exe were no longer in system32.
It is copied to a folder on a flash drive plugged into the same computer.

Please note I would never actually delete cmd.exe from its default folder.

Re: What external files are needed to run cmd

Posted: 03 Oct 2016 07:08
by Squashman
How did you execute the batch file?

I would assume you attempted to do this if they are both in the same directory.

Code: Select all

cmd /c "mybatch.bat"

Re: What external files are needed to run cmd

Posted: 03 Oct 2016 07:27
by penpen

Re: What external files are needed to run cmd

Posted: 03 Oct 2016 08:41
by ShadowThief
I suppose in theory if you're pasting cmd.exe into a hypothetical custom OS environment that somehow magically works without a C:\Windows directory, you'd be missing commands like CHOICE and XCOPY.

http://ss64.com/nt/ - every command that isn't followed by a •

Re: What external files are needed to run cmd

Posted: 03 Oct 2016 09:55
by batchcc
Thanks ShadowThief, I'm sorry about the wording of the question I will try to get better at that