3

I am making a program that optimises a PC and I have made some exe's I need a bat file that can run them even if they had an extension like "abc". I cant have them with the exe extention because if they were executed not in order it could be fatal

EDIT: does any one know how I could do the same but with a reg file with a "abc" extention as well. Thanks.

6
  • 1
    Wouldn't it be better to have something else know the order of execution? Also if the order of execution, when incorrect, is fatal - I'd be entirely dubious running this at all! :) Commented Jan 9, 2014 at 11:03
  • It is because one adds a new explorer.exe and one deletes it and if you delete it with out the one that adds the new one it would be a problem to fix. Commented Jan 9, 2014 at 11:05
  • 1
    Looks more like a design problem to me. What does prevent you from using the file names themselves a sort key? Or maintaining a sorted list of the programs to be executed? Messing up with file extensions is never a good idea IMHO, especially on Windows. Commented Jan 9, 2014 at 11:06
  • I don't want any one to accidentally run the wrong file. Commented Jan 9, 2014 at 11:08
  • 1
    Sounds like there is something seriously wrong with your whole design here. You plan to leave free access to potentially lethal programs and hope disguising them will be enough to prevent a tragedy? Am I glad you don't work in a weapon factory! Commented Jan 9, 2014 at 11:11

1 Answer 1

4

you dont need to change the registry to run an file with different extension.YOu just need to add the extension to %PATHEXT% :

set "pathext=%pathext%;.exe1" call sample.exe1 

to make a an .abc file to act as .reg try this:

assoc .abc=regfile 
Sign up to request clarification or add additional context in comments.

4 Comments

Looks like a license to kill to me. Windows is already full of pitfalls, no need to dig up your own, or so I think.
@kuroi neko IF you spend your whole life playing it safe then you will learn little.
@09stephenb Hahaha that's a good one. I have had my share of pizza parties in front of a buggy piece of software, but thanks all the same for the advice.
Is the supplied example using pathext working because the short filename extension is .exe ? Will this work if it is abc ? It doesn't work in a batch file in my test, either way.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.