2

My goal is to run a VBScript file (.vbs) from an executable file (.exe) located in the same directory "E:\". What would be the simplest way to make the executable file?

I won't use something similar to "BAT to EXE Converter" or "VBS to EXE" because they're creating a file in the TMP folder, and I don't want that, it's not a simple way to open a file: the application could simply open the .vbs file already created i nstead of creating, opening and deleting a batch file that would start the .vbs file.

Why do I ask this? E: is a CD drive (I store data in it by making ISO files and mounting them). I want a .vbs file to run once the CD is inserted to a PC so I made the autorun.inf file but the problem is that it can only open a .exe file, it doesn't work when I type open=launch.vbs

  • You can always use AutoHotkey or the like for stuff like this. – Daniel B Nov 2 '14 at 22:03
5

You should be able to trigger batch files (.bat) from autorun.inf. Then, script the batch file to run your VBS file.

| improve this answer | |
  • How to run the batch file in background? – SkYWAGz Nov 2 '14 at 7:55
  • 1
    I don't think that is possible through autorun.inf, but you should be able to achieve it using multiple BAT files. Check this – jjk_charles Nov 2 '14 at 8:06
2

To start a script, you should pass the specified script file contents to the registered script engine. You can run either of Windows Script Host engine versions by typing wscript.exe or cscript.exe (followed at least script name) at a command prompt.

In your case, you could use fully qualified path of choosen WSH engine at open entry in your Autorun.inf file.

Or you could use the shellexecute entry instead:

[AutoRun]
shellexecute="launch.vbs"
UseAutoPlay=1
| improve this answer | |
  • I want my cd to be universal, and autoplay 2 is not always available, but I answered my own question – SkYWAGz Nov 2 '14 at 21:34

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.