Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: How to create a duplicate cmd.exe under Win7 SP1?

06 Aug 2014   #1
alacarre

Windows 7 Ultimate 32 bit
 
 
How to create a duplicate cmd.exe under Win7 SP1?

I know, you're shaking your head and about to type in:

  1. copy %windir%\system32\cmd.exe C:\MyUtilities\cmd.exe (or failing that)
  2. copy %windir%\system32\cmd.exe C:\MyUtilities\MyCmd.exe

And, getting ready with the follow up "You can always just run it twice. That's allowed".

Well, there are two problems with those answers. The first answer has the unfortunate property of being wrong. Well, not "wrong", exactly; the program won't function correctly unless it is called cmd.exe and in the system32 directory and there must exist another copy in a specially named folder, and a special "encrypted copy" with an ".mui" extension also having a duplicate in a specially named folder.

In fact, cmd.exe only works properly (as far as I can tell) as long as you have the following collection of pairs of identical binaries:
Collection 1:
C:\Windows\System32\cmd.exe
C:\Windows\winsxs\x86_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7601.17514_none_8d1430a8789ea27a\cmd.exe

Collection 2:
C:\Windows\System32\en-US\cmd.exe.mui
C:\Windows\winsxs\x86_microsoft-windows-c..andprompt.resources_31bf3856ad364e35_6.1.7601.17514_en-us_81894823f02c4c17\cmd.exe.mui
Added to that, just as a triple check here's what "fc" says:

C:\Windows>fc C:\Windows\System32\cmd.exe C:\Windows\winsxs\x86_microsoft-windows-commandprompt_31bf3856ad364e35_6.1.7601.17514_none_8d1430a8789ea27a\cmd.exe

Comparing files C:\WINDOWS\SYSTEM32\cmd.exe and C:\WINDOWS\WINSXS\X86_MICROSOFT-WINDOWS-COMMANDPROMPT_31BF3856AD364E35_6.1.7601.17514_NONE_8D1430A8789EA27A\CMD.EXE
FC: no differences encountered

and, as you can probably guess:

C:\Windows>fc C:\Windows\System32\en-US\cmd.exe.mui C:\Windows\winsxs\x86_micros
oft-windows-c..andprompt.resources_31bf3856ad364e35_6.1.7601.17514_en-us_8189482
3f02c4c17\cmd.exe.mui

Comparing files C:\WINDOWS\SYSTEM32\EN-US\cmd.exe.mui and C:\WINDOWS\WINSXS\X86_MICROSOFT-WINDOWS-C..ANDPROMPT.RESOURCES_31BF3856AD364E35_6.1.7601.17514_EN-US_81894823F02C4C17\CMD.EXE.MUI
FC: no differences encountered

With the caveat that:

C:\Windows>fc C:\Windows\System32\cmd.exe C:\Windows\System32\en-US\cmd.exe.mui

Comparing files C:\WINDOWS\SYSTEM32\cmd.exe and C:\WINDOWS\SYSTEM32\EN-US\CMD.EXE.MUI
0000003C: E8 B8
00000080: DE 01
00000081: 4E 75
00000082: 92 F5
00000083: B9 D9
00000084: 9A 45
00000085: 2F 14
00000086: FC 9B
... etc

And if you try to run cmd.exe from any other directory it *can* work, but you get directory listings (or any listing) like this:

************************************************
C:\Windows>d:cmd
The system cannot find message text for message number 0x2350 in the message file for Application.

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows>dir
The system cannot find message text for message number 0x235f in the message file for Application.
The system cannot find message text for message number 0x235b in the message file for Application.

The system cannot find message text for message number 0x2339 in the message file for Application.
08/06/2014 09:26 PM The system cannot find message text for message number 0x2373 in the message file for Application.
.
08/06/2014 09:26 PM The system cannot find message text for message number 0x2373 in the message file for Application.
..
07/14/2009 09:37 AM The system cannot find message text for message number 0x2373 in the message file for Application.
AppCompat
11/21/2010 07:38 AM The system cannot find message text for message number 0x2373 in the message file for Application.

ETC ....

07/14/2009 08:14 AM 31,232 twunk_32.exe
06/11/2009 04:14 AM 51,867 Ultimate.xml
07/14/2009 11:54 AM 403 win.ini
08/06/2014 08:43 PM 1,404,268 WindowsUpdate.log
06/11/2009 04:42 AM 256,192 winhelp.exe
07/14/2009 08:14 AM 9,728 winhlp32.exe
06/11/2009 04:34 AM 316,640 WMSysPr9.prx
07/14/2009 08:14 AM 9,216 write.exe
The system cannot find message text for message number 0x2378 in the message file for Application.
The system cannot find message text for message number 0x2379 in the message file for Application.

************************************************

And you can probably guess why.

Now, prior to being forced to install SP1 (because I accidentally messed up my registry and Windows "accidentally" deleted all my restore points so I had to do a re-install from scratch) I discovered a way around this which was simply to put your copy of cmd.exe under a new name (CommandProcessor.exe say) and create a .mui file in the en-US folder which was also an exact copy of cmd.exe (which it isn't possible with the new and improved version)

So I could have two "product instances" (for lack of a better word) of cmd.exe. And the reason that is desirable, if not necessary, is because one of them is running with administrator rights and the other with standard rights and I need to be able to distinguish between these two completely different beasts and not have them occupy the same position on the taskbar. In fact, I had disabled the update service only because I knew this change was coming.

The reason why it is of critical importance that the two instances do not appear together is because I know with 100% certainty that otherwise I will eventually make a mistake and run *explorer* from the wrong box say, when it crashes (or more likely when I kill it as I often do).

Following that, now unbeknownst to me, I would be running everything with administrator privileges for as long as that explorer's session lasts (ie. up to days).

Any ideas? I would like to duplicate this "gang of 4" and simply have a differently named program that has the same code in it as cmd.exe

Thanks in advance,
Alan


My System SpecsSystem Spec
.
06 Aug 2014   #2
msalton1

windows 7 Pro 64 Bit
 
 

Maybe I'm missing something, but couldn't you just create shortcuts to the command prompt, editing the properties to run as admin for those you wish?

To differentiate, just name the shortcuts as you wish, and the new name will show up on the title bar, along with "Administrator:cmd.exe and the name of the shortcut in both the title bar and the taskbar tooltip (non-admin will just show whatever you've named the shortcut).

Changing the icon via the shortcut properties causes the taskbar to display that icon.

IOW, it's all doable via the shortcut properties.
My System SpecsSystem Spec
06 Aug 2014   #3
alacarre

Windows 7 Ultimate 32 bit
 
 

It displays the first icon it sees, but groups them together ever after. If it's the same program then they get put in the same slot (under win7). If you change the name of the binary, then and *only* then will they be separated.

[Edited to add]
I already have the two shortcuts, I've had them for ages. I select them as needed, but I don't usually close cmd because I'll be working there. Sometimes the work requires an admin action, sometimes not.

[One more edit]
Administrator: is not enough visible differentiation to prevent the accident I described. I barely ever read the title bars. Instead I use a different color background. But still, I don't want them together on the taskbar.
My System SpecsSystem Spec
.

06 Aug 2014   #4
msalton1

windows 7 Pro 64 Bit
 
 

Maybe setting the taskbar properties to "Never Combine"?
My System SpecsSystem Spec
06 Aug 2014   #5
alacarre

Windows 7 Ultimate 32 bit
 
 

Haha, well I tried that. It would seem to be the only solution. So I have to change the way everything works because of one thing that doesn't work. I may do it, but I think there must be a way to create a copy of a program and have it run.
My System SpecsSystem Spec
06 Aug 2014   #6
msalton1

windows 7 Pro 64 Bit
 
 

Seems to work here:

How to create a duplicate cmd.exe under Win7 SP1?-cmd-tasks.jpg


My System SpecsSystem Spec
06 Aug 2014   #7
msalton1

windows 7 Pro 64 Bit
 
 

I prefer the never combine setting. I also set the icons to 'small', the taskbar to autohide and resize it vertically to handle the pinned icons and two rows of running apps. It can be frustrating to arrange it all, but I find it works well.
My System SpecsSystem Spec
06 Aug 2014   #8
msalton1

windows 7 Pro 64 Bit
 
 

How to create a duplicate cmd.exe under Win7 SP1?-taskbar.jpg


My System SpecsSystem Spec
06 Aug 2014   #9
alacarre

Windows 7 Ultimate 32 bit
 
 

Quote   Quote: Originally Posted by msalton1 View Post
Seems to work here:

Attachment 328345
What am I looking at?
My System SpecsSystem Spec
06 Aug 2014   #10
msalton1

windows 7 Pro 64 Bit
 
 

Quote   Quote: Originally Posted by alacarre View Post
Quote   Quote: Originally Posted by msalton1 View Post
Seems to work here:

Attachment 328345
What am I looking at?
That's the taskbar shortcuts on the bottom...an explorer window containing the shortcuts on top. My subsequent image should clear it up.
My System SpecsSystem Spec
Reply

 How to create a duplicate cmd.exe under Win7 SP1?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Duplicate Win7 Installation
Hi, Sorry if this post is in the wrong place but becoming somewhat of a desperate man here! I recently was required to format my laptop after having an issue wherein the BOOTMGR was missing this for me was a massive issue not so much in losing data, it is that the DVD drive on my laptop is...
Installation & Setup
how to create an iso of my win7 64 bit
is there a way i can back up my PC and have it in an iso format? I have looked at acronis but it give me an .tib. I want to create and ISO of my whole PC to an external nas. any help will be very helpful
Backup and Restore
Create Win7 installation on new disc and remove old Win7 install
Scenario is I have a new sata3 SSD drive on which I want to install Win7. The PC has an existing build of Win7 on a different disc which i want to reformat & use for data. I tried this previously and ended up with a dual booting system. Trying to remove the old Win7 installation and format that...
General Discussion
create partitions on win7
I want to make partition on my hard drive. my hard drive is divided in to just one partition. i want to create 3 or 4 further partitions. Can i do it?
General Discussion
no way to duplicate a file in win7?
In xp you could press ctrl and alt and drag a file or folder and it would duplicate it, I used to do this a lot. Now this suddenly doesnt work? Its now "move file" which to me is useless. Is there no shortcut to duplicate a file anymore? It seems annoying they just completely removed something. ...
General Discussion
How to install AIK and then create a Win7 dvd
I have recently upgraded my computer from vista to seven and as i had many problems with it, I was later advised to make a clean reinstall. Details of my problems here: http://www.sevenforums.com/performance-maintenance/36350-very-slow-seven-32bit-unable-install-updates.html To do so, since...
Installation & Setup


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 03:58.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App