• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1073
  • Last Modified:

Can't open cmd.exe in Windows 2003

We've taken over a server that appears to have been infected with spyware or some viruses, which I think we've cleaned off. Symantec AV, AVG, MalwareBytes, and Windows Defender have all found infections that they said they cleaned, and we've rebooted after each one. now the server appears to be clean, but we can't open the command line.

Every time we launch cmd.exe (from the Start menu, the Run command, or the System32 folder) the window comes up and shows "tftp.exe" in the upper-left instead of the CMD.exe location. Instead of the folder location in the main window, it shows "Password_" . As soon as we enter any text the window automatically closes.

I've copied the CMD.EXE file from a different server that works as well as a Windows 2003 CD, but they all do the exact same thing. We've also installed all Windows 2003 updates.

We need to get into the command line ASAP to do some work, but have not been able to figure this out.
Any help would be appreciated.

1 Solution
It looks like a software conflicts to me. Please try to test in Safe Mode. Restart the system and press F8, choose Safe Mode during startup.

What’s the result? If the issue doesn’t occur, you can disable third party software one by one to test.
try sfc /scannow or reinstalling the service pack
sfcandersonAuthor Commented:
I'll try safe mode in about an hour. This is a domain controller, so I think that means we need to do Directory Services Restore Mode?

I've already tried sfc /scannow, but it doesn't do anything. The black window for the command line will pop up for 1/2 second and then disappear.

I'm nervous about reinstalling SP2 because it's been on there for so long. Couldn't this cause a conflict with the other updates that have been installed over the years?
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

This definitely was caused by the virus.  
copy the following and save it to a file named cmdfix.reg and then run it on the server and it should put the correct file association back to the CMD extension.

copy all below here:

Windows Registry Editor Version 5.00



@="Windows Command Script"






@="\"%1\" %*"









[HKEY_CLASSES_ROOT\cmdfile\shellex\PropertySheetHandlers\ShimLayer Property Page]
sfcandersonAuthor Commented:
sweeps, I tried running that Registry key but am having problems. When I just run the file it tells me "The specified file is not a registry script. you can only import binary registry files from within the registry editor."

So, I opened regedit and imported the file. The first time it said "Cannot import ...filename... The key selected is invalid."

After that I edited the permissions on the HKEY_CLASSES_ROOT hive to ensure I had full rights on everything and ran it again. The second time I got this message:

"Cannot import...filename...: The specified file is not a registry file. You can import only registry files."
attached is the registry file.  I have verified the entries match 2 of our 2003 servers so there should be no issue.  Please let me know if this still has import errors.
One thing I would mention is that if the server is having extenstion issues with cmd most likely it will have other extension issues.  If the virus was this extreeme the best solution is a rebuild.  

Just saying
sfcandersonAuthor Commented:
Downloaded your file, which ran successfully but did not fix the problem.

We're actually trying to remove this server, but it's the only domain controller so we have to get the new one running before we can demote this one. The new server is Windows 2008, so we have to get to the command line to prep the domain before we can proceed.
I have talked with our systems engineer and he had the same idea as me.  Sorry but this is beyond me without having it sitting here.  

sfcandersonAuthor Commented:
Ugh, we restarted into safe mode but the problem is still occurring. Any more thoughts on how to get into the command prompt?

Are there any other ways to upgrade AD without using the command prompts?
What is it you need to run on the bad server?  Maybe I can help with that part.
sfcandersonAuthor Commented:
We're trying to run ADprep and forestprep to get the new Windows 2008 server in.
can you try running the following.  see if command prompt fixes

Open Start >> Run and type the following command ( or just copy it )  

REG add HKCU\Software\Policies\Microsoft\Windows\System /v DisableCMD /t REG_DWORD /d 0 /f

this should reset command prompt for logged in user...

still looking into vbscript to run adprep  will let you know if I can get it to work in our test environment.
sfcandersonAuthor Commented:
Thanks for continuing to try, but that command didn't fix it either!

If we can run the domainprep and forestprep from the Run command (or a VMScript) then we should be OK. Let me know if you find anything out, otherwise we'll try it again at the end of the day, which is the next time we have cleared for downtime.
I am unable to get it to work without error in VB

I will keep trying and let you know if I can get it to go.
sfcandersonAuthor Commented:
Actually, I think we've found a solution. we use a managed services application that gives us command line access through a remote app, which seems to be working. We're going to try that in a few minutes and see if it's functonal.
Good luck!  hope it works
sfcandersonAuthor Commented:
Well, none of that worked so we ended up going with a new domain. This was a pretty small company, so eventually we decided that it would take less time to join a few computers to the domain rather than continue troubleshooting. Thanks for all of your help, though. They were great suggestions.
sfcandersonAuthor Commented:
Expert's solutions were excellent, but did not fix the problem.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now