Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Command Prompt and .bat files close instantly


  • Please log in to reply
6 replies to this topic

#1 NinjaOfLU

NinjaOfLU

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:06:02 AM

Posted 22 August 2015 - 02:07 PM

Hello, I really need help. (and by the way, I'm new here, so I'm sorry if I do anything wrong)

 

My command prompt and batch files have stopped working, I'm a programmer, and testing some new things recently (requiring .bat files), so I really need help!

 

I tried to find the solution to the problem myself in several ways: I've been testing the command prompt in various different ways, but only found one way of making it work, and that was in a very impractical way (Windows 10 advanced restart -> command prompt). This led me to think that it may be a virus, or some other program, executing at startup, but so far, I have not been able to find which it could be.

 

In terms as precise as I can give, the problem is the following:

  • When activated, the window executing the command closes instantly, before running any command, or giving me a chance to enter input.
  • This problem does not occur however, when the command prompt is executed without any other programs.
  • I have tried going through background processes, but I haven't located one yet in which malignant code may be in-bedded.
  • If you need any extra information, please ask, I probably have more that I have forgotten/don't know the importance of.

 

This problem began to occur when I had Windows 7 btw - if that is of any use.



BC AdBot (Login to Remove)

 


#2 packetanalyzer

packetanalyzer

  • Members
  • 954 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:01:02 AM

Posted 22 August 2015 - 02:23 PM

This problem began to occur when I had Windows 7 btw - if that is of any use.

 

That is of use because it tells us it has nothing to do with Windows 10. When you click start and type "cmd" if you right click and select "Run as Administrator" does that make a difference?

 

If you think your computer is infected there are a number of programs you can use to try to detect it, but I do like MalwareBytes. IMO it works well and effectively removes infections other programs don't detect.

 

You might also want to check startup programs against the Startup List.


Edited by packetanalyzer, 22 August 2015 - 02:26 PM.


#3 NinjaOfLU

NinjaOfLU
  • Topic Starter

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:06:02 AM

Posted 22 August 2015 - 03:44 PM

Uh, no, I thought of running as an admin, and it made no difference. I have checked the startup list too, and scanned with Malwarbytes.



#4 jonuk76

jonuk76

  • Members
  • 2,179 posts
  • ONLINE
  •  
  • Gender:Male
  • Location:Wales, UK
  • Local time:06:02 AM

Posted 22 August 2015 - 05:53 PM

Sounds weird.  It's a pretty fundamental part of the operating system.  If you type cmd.exe into the search box and click "Run Command" what happens exactly?  How about Powershell, does that work?  Powershell is a more advanced version of the command prompt.

 

It's possible to disable command prompt using the registry or group policies.  This might be useful in some situations, e.g. on a network where perhaps an admin doesn't want users to be messing around with command prompt.  This gives details of how to enable/disable using these methods - http://www.thewindowsclub.com/enable-disable-command-prompt-windows

 

It's also possible that malware could disable it, perhaps in an attempt to make removing it that much harder..  If you think that's a possibility, there's other sections of the forum for that.


7sbvuf-6.png


#5 NinjaOfLU

NinjaOfLU
  • Topic Starter

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:06:02 AM

Posted 23 August 2015 - 05:24 AM

Thanks for your help guys, I think I'll move to the malware forum. Just one thing though, I did a test a while back, and although (stupidly) I didn't save the result, I think I may be able to remember enough to give you a tiny bit more information.

 

Basically, what I did was to screenshot the command prompt as it was closing (the slight shrinking animation when a window closes on Windows 7 letting me see it), and the only thing that I can remember that came up was 'press any key to continue'. Not too sure if that will help?

 

If not, then thanks so much for your help, and I'll be moving to a new topic (I'll put the link below once I've made the topic).



#6 NinjaOfLU

NinjaOfLU
  • Topic Starter

  • Members
  • 4 posts
  • OFFLINE
  •  
  • Local time:06:02 AM

Posted 23 August 2015 - 05:36 AM

Sorry, I just added the directories to create the DisableCMD DWORD, and then I set its value to 1. This is where it gets slightly odd, because once I set that, it comes up telling me that the command prompt has been disabled by my system administrator, whereas in fact, setting it to 0 should disable it, and 1 should enable it.

 

I also just tested it with the DWORD value as 0, and then it went back to the old problem - the same thing happening when just to check, I tried it with 2


Edited by NinjaOfLU, 23 August 2015 - 05:42 AM.


#7 packetanalyzer

packetanalyzer

  • Members
  • 954 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Local time:01:02 AM

Posted 23 August 2015 - 12:36 PM

Sorry, I just added the directories to create the DisableCMD DWORD, and then I set its value to 1. This is where it gets slightly odd, because once I set that, it comes up telling me that the command prompt has been disabled by my system administrator, whereas in fact, setting it to 0 should disable it, and 1 should enable it.

 

I also just tested it with the DWORD value as 0, and then it went back to the old problem - the same thing happening when just to check, I tried it with 2

 

That is actually normal. DisableCMD is the registry key that is set by the Local Security Policy or Group Policy. The wording can be confusing but if you set DisableCMD DWORD to 1 that means that disabling command prompt is true.

 

If you disable DisableCMD then Command Prompt is Enabled (set to 0). If you enable DisableCMD then Command Prompt is Disabled (set to 1).






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users