What external files are needed to run cmd

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

What external files are needed to run cmd

#1 Post by batchcc » 03 Oct 2016 06:27

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)?

penpen
Expert
Posts: 1991
Joined: 23 Jun 2013 06:15
Location: Germany

Re: What external files are needed to run cmd

#2 Post by penpen » 03 Oct 2016 06:35

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

batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

Re: What external files are needed to run cmd

#3 Post by batchcc » 03 Oct 2016 06:55

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.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

Re: What external files are needed to run cmd

#4 Post by Squashman » 03 Oct 2016 07:08

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"

penpen
Expert
Posts: 1991
Joined: 23 Jun 2013 06:15
Location: Germany

Re: What external files are needed to run cmd

#5 Post by penpen » 03 Oct 2016 07:27


ShadowThief
Expert
Posts: 1160
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: What external files are needed to run cmd

#6 Post by ShadowThief » 03 Oct 2016 08:41

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 •

batchcc
Posts: 139
Joined: 17 Aug 2015 06:05
Contact:

Re: What external files are needed to run cmd

#7 Post by batchcc » 03 Oct 2016 09:55

Thanks ShadowThief, I'm sorry about the wording of the question I will try to get better at that

Post Reply