Run .bat files with cmd again


0

Hey, I accidentially went to go and run a .bat file and I (instead of using cmd) chose the default application to be notepad.exe

I attempted to reset the .bat extensions registry, however that did not work. How do I make it go back to default app being cmd?

http://prntscr.com/ajxhiy

P.s. Some of those files name(s) were changed to fool people into thinking they do something they don’t (it’s a prank lol)

Thanks guys!!! (Also, I couldn’t find anything on Google… Maybe I wasn’t searching up what I needed to…)

32replies
9voices
343views
4images
cn9 [1337boy]
8 years ago

1

you can’t revert
have to format now :‘(


0

Format my pc? @1337boy

cn9 [1337boy]
8 years ago

0

if changing the register didn’t solved that yes :‘(

also

black00vikingpro: it’s just a prank bro
s4m p3pp3r confirmed


0

K, unless I was changing the registry to something else, or not the right thing. Whats your registry for the .bat files?

cn9 [1337boy]
8 years ago

1

i don’t have windows

Mugi [Mugiwara27]
8 years ago

1

Just do right click on file, open with –> choose other and set one program by default
In your case you would choose cmd as default program when it’s about .bat format file :)

dloser
8 years ago

0

The former hacker strikes again!


0

http://prntscr.com/ajyywg

these are the only options I get in the context menu………..

Mugi [Mugiwara27]
8 years ago

0

Go to properties

@dloser lol.. again

Mr. Cyph3r [MrCyph3r]
8 years ago

0

Sometimes it works if you just plug off your graphics card and plug it back in, for me it worked several times. The only problem is when you have a laptop, if this is the case unfortunately you have to completely format your laptop. Be sure to take a backup of all your files, including the registry so that you can restore it back.

DOSmaster
8 years ago

0

*Sigh

Here:
assoc .bat=batfile

PS.: Start C:\Windows\System32\cmd.exe with elevated rights first (Administrator) before executing the command.

Mr. Cyph3r [MrCyph3r]
8 years ago

0

It’s interesting to see how this guy keeps receiving correct answers to his questions…

cn9 [1337boy]
8 years ago

0

not from dloser :P

dloser
8 years ago

2

Na na na na na na na na na na na na na na na na Batfile!

.batjoke

DOSmaster
8 years ago

0

Soon my tolerance of pebcak will be low again. :P

and @dloser Oh wow..


0

http://prntscr.com/ak48hm < Sorry @DOSmaster , the cmd thing did not work :/

DOSmaster
8 years ago

1

The hell?
Did you retry to open it? :D

Maybe this is what you need.
ftype batfile=C:\Windows\System32\cmd.exe "%1" && assoc .bat=batfile

Before:
Image

After:
Image

Then retry opening the file.

Might there be an issue then:
procedure OpenHelp; const helpUrl = 'http://superuser.com/questions/29717/associate-a-file-type-with-a-specific-program'; begin ShellExecute(Application.Handle, 'open', PChar(helpUrl), nil, nil, SW_SHOWNORMAL); end;

Numlock90
8 years ago

0

Excellent last bit of code there DOS master, seems like this will really help OP.
Will also give him a place for his questions.

I sense your tolerance for pibcac is wavering.


0

@DOSmaster This didn’t work either. Plus, I dunno where to execute that last bit of code…

Image

It did change the registry though, back to it’s original, unchanged form.

Image

I really don’t know how I messed it up THIS much. Kinda dissapointing though. I can still run .bat files, just have to have the .cmd extension instead of .bat…… The .cmd extension still works!


0

I even attempted this too > http://prntscr.com/akam9k

dloser
8 years ago | edited 8 years ago

0

Are we still on this? :P

The default settings are:
C:\>ftype batfile && assoc .bat batfile="%1" %* .bat=batfile C:\>

@DOSmaster**: cmd.exe doesn’t accept a command line (edit: or executable) as argument.

dloser
8 years ago

0

You can also try running ‘reg query HKCR.bat /s’ and ‘reg query HKCR\batfile /s’ and check/post the output of that for anything strange.

b1nary
8 years ago

0

jeez , just shift+right click –> Open command window here –>type mybatfile.bat press enter and it will run.

dloser
8 years ago

0

Yes. And what I usually do is open the file in notepad and execute the commands in it manually. :)

DOSmaster
8 years ago

0

What noob still uses command prompt? PowerShell is the shit these days Vomits at my own words

ITPPA
8 years ago

0

What about:
- SHIFT+Right clic on a .bat file
- “Open with”
- Browse
go to: C:/windows/systme32/
Select: cmd.exe
- select: “remember this option”.

Done.

DOSmaster
8 years ago

0

Windows users….
Try doing it with commands over CLI, not via GUI elements…

ITPPA
8 years ago | edited 8 years ago

0

Or in other way:
Try gnome-terminal, konsole, xterm, rxvt, kvt, nxterm or eterm…. with sh (bourne shell),ash,bash,dash,zsh,or ksh if you want, but don’t use microsoft…From DOS to powershell, you’ll never have the same experience ;)

ok i ->[ ]

DOSmaster
8 years ago

0

You array? :P
And PS isn’t as easy as it looks either, when you get into managing servers with it.
But I strongly agree on Linux distros being waaay better then Windows. (Unless you’re called OpenSuse or Ubuntu.)

PS.: I think you forgot to write Bourne-again shell (B.A.Sh or BASH as we know it.) as it’s the Linux version of the Unix v7 Bourne Shell (SH) {It could be that 32v has it as well, but I am not sure about that.}

ITPPA
8 years ago

0

[quote=DOSmaster]PS.: I think you forgot to write Bourne-again shell (B.A.Sh or BASH as we know it.)[/quote]
No no, i don’t:

with sh (bourne shell),ash,

bash
,dash,zsh,or ksh if you want

[Mode history on]
The Bourne shell (Sh) was the default shell for Unix Version 7. (made in 1977)
https://en.wikipedia.org/wiki/Bourne_shell
bash = Bourne-again shell is a Unix shell and command language for the GNU Project as a free software replacement for the Bourne shell. (made in 1989)
[Mode history off]

And :
POWERSHELL: First appeared the 14 November 2006 :)
Microsoft take 29 year to realize that CLI is better than GUI ;)

my first answer makes perfect sense, for a windows question, need a windows answer…

the array[] goes… :p

PS: We don’t know yet if BlackViking have succeeded for his probleme!

DOSmaster
8 years ago

0

Probably used my GetHelp Pascal procedure :P

ITPPA
8 years ago

0

Mr william’s best for sure.
oups sorry, I’m already gone…. OK I leave… again

You must be logged in to reply to this discussion. Login
1 of 33

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss