DOS not running via windows explorer

Excel2006

Active Member
Joined
Dec 19, 2006
Messages
455
Hi

I have created lots of BATCH files that used to run via windows explorer.
However, whenever I click on the files now, I get a “Open with” dialog box and the
“always use selected program….” is blanked out.
What could be the cause of this?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Check under Tools-Folder options in explorer and see what, if anything, is set for the .bat file type. There shouldn't really be anything there. If there isn't, you can either rename the files with a CMD extension or add a new file type of BAT and associate it with MSDOS batch files.
 
Last edited:
Upvote 0
Thx. That's so simple!! WHat could be the cause of this? Does my PC has some kind of virus on it?
 
Upvote 0
Nope - mine is the same. I suspect there was a Windows update (probably security related) or our IT department (and possibly yours) have been fannying around again.
 
Upvote 0
SInce I have so many batch files with .bat extension, it would take a while to change them all to .CMD.

IS there an easy way to change them using a .cmd file?

I know a few commands in DOS.

Part of the code would be, I think:

ren *.bat *.cmd
 
Upvote 0
Ren doesn't allow you to specify subdirectories. If they are all on the same drive, you would run something like:
Code:
xcopy C:\*.bat *.cmd /s
to copy them as cmd files, or you could simply add .bat to the file types again. You could do the renaming as a loop using a
Code:
for /f %%a IN (’dir /b *.txt’) do call rename.bat %%~na %%~xa
type syntax, but you need to avoid renaming files like autoexec.bat
 
Last edited:
Upvote 0
thx.

1st code

I tried the first code and got a cyclic error.

2nd code:

The system cannot find the file Тdir.
 
Upvote 0
You can't run the first code from a batch file for obvious reasons, if that's what you were doing! You need to run it from a command prompt.
The second code was a rough example of what a loop would look like, not actual code for you to use, due to my point about not renaming certain key batch files.
 
Upvote 0

Forum statistics

Threads
1,216,773
Messages
6,132,637
Members
449,740
Latest member
tinkdrummer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top