Posted: . At: 11:28 AM. This was 5 months ago. Post ID: 18838
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



How to run a Visual Basic Windows script on Ubuntu easily.


Running a Visual Basic Windows script on Ubuntu is very easy, this requires the installation of the 32-bit compatibility layer for Wine, then this will be possible.

Enable the 32-bit libraries for Linux.

┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:/media/jcartwright/My Media/Stuff/Code$ sudo dpkg --add-architecture i386

Then install all of the required libraries.

┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:/media/jcartwright/My Media/Stuff/Code$ sudo apt-get update && sudo apt-get install wine32:i386

Once that is installed, run a sample VB script to test this out with Wine.

┏jcartwright@jcartwright-System-Version╼╸╸╸╸╸╸╾
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━◉:/media/jcartwright/My Media/Stuff/Code$ wine cscript writetext-file.vbs

This worked for me when I tried a simple Visual Basic script with Wine. Below is the sample Visual Basic script I tried. Scripts that spawn a message box even work as well.

Set objFSO =  CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.CreateTextFile("Filename-output.txt", True)

objFile.WriteLine ("Bejiitas Script")

Set object_sh = CreateObject("Wscript.shell")

Set my_command = object_sh.Exec("ipconfig /all")

Result = Replace(my_command. StdOut. ReadAll, vbCrLf, vbNewline)

ObjFile.Writeline result
Wscript.Quit

This is a very simple Linux trick, but it does work.


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.