Command prompt that closes automatically

Solved
titania59 Posted messages 8 Status Membre -  
brucine Posted messages 24390 Registration date   Status Membre Last intervention   -
Hello, I can't start my command prompt; it closes automatically as soon as it's opened. Looking in the registry, here’s what Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor shows when I double-click on autorun: @mode 20,5 & tasklist /FI "IMAGENAME eq SoundModule.exe" 2>NUL | find /I /N "SoundModule.exe">NUL && exit & if exist "C:\Users\florent stanus\AppData\Roaming\Microsoft\SoundModule\SoundModule.exe" ( start /MIN "" "C:\Users\florent stanus\AppData\Roaming\Microsoft\SoundModule\SoundModule.exe" & tasklist /FI "IMAGENAME eq explorer.exe" 2>NUL | find /I /N "explorer.exe">NUL && exit & explorer.exe & exit ) else ( tasklist /FI "IMAGENAME eq explorer.exe" 2>NUL | find /I /N "explorer.exe">NUL && exit & explorer.exe & exit )
Any solution?
Thank you

Configuration: Windows / Opera 78.0.4093.153

1 réponse

Jojolaguitare Posted messages 12012 Registration date   Status Membre Last intervention   2 781
 
Hello.

And if you type

cmd /k

What happens? CMD opens normally? (Open as administrator)

See you later . . .

0
brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098
 
Hello,

The /K switch is supposed to run a tartempion command and then return to the prompt; unless a command is entered, and even if it is, not much should happen.

The switch to prevent cmd from reading an autoruns entry from the registry is /D.

That said, and as long as the script in question apparently related to a sound card is of any use, it is normal for cmd to "automatically" close since, regardless of the situation, it ends with "exit."

The normal syntax if we want cmd to stay open (but in principle for a batch file, like exit itself) is exit /b.

That said, if such a script is necessary for a game or something, I wouldn't put it there, but in an independent batch that we would run at the start of the game.
0
titania59 Posted messages 8 Status Membre
 
Hello, the problem is the same with cmd/k, CMD opens but closes immediately even when launching it as an administrator...
0
brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098 > titania59 Posted messages 8 Status Membre
 
I said what I thought about cmd /k: it's cmd /d that you need to do.
0
titania59 Posted messages 8 Status Membre > brucine Posted messages 24390 Registration date   Status Membre Last intervention  
 
Thank you, I can now open the command prompt again, but the problem is that when I try to run a batch file, it closes automatically again.
0
brucine Posted messages 24390 Registration date   Status Membre Last intervention   4 098 > titania59 Posted messages 8 Status Membre
 
The script is faulty: it commands to close the console with exit at all stages, and it obeys, instead of exit /b which keeps it open.

If you had written it yourself, being somewhat technical, you would know this syntax.

So it is either a "software" that installed it, or more likely a virus (specifically a cryptocurrency miner in this case).
https://stackoverflow.com/questions/58849884/cmd-exe-closes-immediately-unusual-line-in-autorun-registry-entry

In this latter hypothesis, you need to:
-kill the process at ...:
CMD /D Taskkill /F /IM "SoundModule.exe"
-remove the autorun entry: by default, in the Command Processor entry, there is no autorun entry but only a REG_SZ type string with an undefined value.
-go to HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon: same deal, by default, there should not be %comspec% but nothing.
-go to %appdata%\Microsoft\SoundModule or SoundMixer and delete.

With a bit of luck, that should be enough without using a "cleaning" virus software, and the moral is that a solid defense software should be installed on the computer and caution should be exercised with what is downloaded.

Regarding its operation, the /d switch orders to disregard the autorun entry in the following command, but by default, autorun will be read again when launching another instance of cmd (unless /b is placed after each exit) and as long as this entry exists.
0