Is it possible to run a VBScript in UNIX environment? Is it possible to run a VBScript in UNIX environment? unix unix

Is it possible to run a VBScript in UNIX environment?


Not sure about Unices, but on GNU/Linux it is possible to run VBScript using Wine, but VBScript support is limited.

On Debian/Ubuntu you can install as follows:

$ sudo apt-get install wine ...$ 

To run from command line:

$ wine cscript some-script.vbs

or

$ wine wscript some-script.vbs

For example I can run following script using Wine 1.7.19 from Ubuntu Wine PPA:

' test.vbs'WScript.Echo "Echo test"  ' doesn't work'MsgBox "Message box!"     ' look like doesn't work either' Write to file - worksSet objFSO = CreateObject("Scripting.FileSystemObject")Set objFile = objFSO.CreateTextFile("out.txt", True)objFile.Write "Output to file test" & vbCrLfobjFile.Close

run:

$ wine cscript test.vbsfixme:vbscript:VBScript_SetScriptState unimplemented SCRIPTSTATE_INITIALIZEDfixme:scrrun:textstream_Close (0x13e208): stub$ cat out.txtOutput to file test$


The simple answer to your question is Yes we can run VBScript on UNIX. But you will not be able to run excel on it. Although even if you get Excel to run using WINE I dont know how it would link the COM objects in the Excel to VBScript .

One possible altenative could be to install OpenOffice on the *NIX box and then configure OpenOffice to save and create Excel Docs(but I am not very sure about this)


You can install vbsedit on your windows box, use it to create and executable from the vbscript. You can then use Wine/PlayonLinux to run the executable code.