Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a two version of my autorun.exe

  • for windows 7
  • for older OS

I need a way, other than using .net or VB, to start silently with no window, check for the OS version, and start an appropriated exe accordingly.

I wrote a batch, that works, but I can't start it silently from the autorun.inf.

share|improve this question

closed as off-topic by Nifle, random Jan 10 at 15:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking product, service, or learning material recommendations are off-topic because they become outdated quickly and attract opinion-based answers. Instead, describe your situation and the specific problem you're trying to solve. Share your research. Here are a few suggestions on how to properly ask this type of question." – Nifle, random
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

up vote 2 down vote accepted

AutoIT can perform this sort of operation and create a small executable which doesn't require .NET or any other runtime pre-installed.

Switch @OSVersion

    Case "WIN_7"
        Run( "versionA.exe" )

    Case "WIN_VISTA", "WIN_XP"
        Run( "versionB.exe" )

    Case Else
        Run( "versionC.exe" )

share|improve this answer

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