I have a folder with a batch file in it. I don't want users to search for that batch file and then run it. Instead copy it as a portable software and just click the folder(actually an executable) which then runs the batch file inside the folder.

Something similar to what install4j does to jar files.

  • 2
    Try researching for 7zip and SFX. That will meet your needs – Ganesh R. Jun 13 '19 at 7:55
  • SFX as in? All I get is Sound Effects. – Tarun Maganti Jun 13 '19 at 10:32
  • See sevenzip.osdn.jp/chm/cmdline/switches/sfx.htm. For latest command line options, install 7 zip and open help – Ganesh R. Jun 13 '19 at 10:49
  • This is an anwer and exactly what I want. – Tarun Maganti Jun 13 '19 at 11:32
  • 1
    Came here to answer this a few hours ago and see this absolute mad man in the comments; I finally gave in and posted an answer so it could be accepted and so this will stop popping up in "unanswered". my guilt will eventually wane, or if @Ganesh wants to post one I can delete mine and be free. – mael' Jun 13 '19 at 19:26

As @Ganesh R. stated in the comments, the thing to look into is self-extracting archive executables. There are several utilities you can use to make these (WinZip, WinRAR, etc.) but the easiest (and free-est) for most people is 7-Zip. There are a lot of great answers and walkthroughs here on superuser.

I understand you'll be using it as portable software, but keep in mind that with default settings users will have the same access to the executable as they would to a batch file - it does not require administrative privileges to run it. If you're looking to keep it safer you may also want to consider changing its permissions, making it hidden, and/or encrypting it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.