I'm trying to call a VBScript to launch in 32-bit from with-in an Access VBA function. I have tried several different variations of Shell, but nothing seems to work, here is my most recent try:
Function callVS()
Dim wsh As Object
Set wsh = CreateObject("Wscript.Shell")
Dim errorCode As Integer
errorCode = wsh.Run("C:\Windows\syswow64\cscript.exe '\\hct431vntgta901\test scripts\machine queries\queryTest.vbs'", 1, True)
If errorCode <> 0 Then
MsgBox "Error was recieved"
End If
End Function
The script receives an error every time I try to run it, I cannot see what the error is, it just fails to run the script.
I have tried and if I run the following command in CMD it runs the script just fine:
C:\Windows\syswow64\cscript.exe "\\hct431vntgta901\test scripts\machine queries\queryTest.vbs"