The Dude, changes in vbs handling from 3.6 to 4 ?

Hello together.
I like to update the dude to the 4b3 version. in my test environment i expected some problems with handling VBscripts.

Here’s the code, that works fine with 3.6, but not with 4b3
I read the system time via this script from the Windows Host

Set objPassword = CreateObject("ScriptPW.Password")

strDomain = "DOMAIN"
strUser = "user"
strPassword = "test"
strComputer = wscript.arguments(0)

Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objWMIService = objSWbemLocator.ConnectServer(strComputer, _
    "root\CIMV2", _
    strUser, _
    strPassword, _
    "MS_409", _
    "NTLMDomain:" + strDomain)

Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")

For Each objItem in colItems
    dtmLocalTime = objItem.LocalDateTime
    dtmHour = Mid(dtmLocalTime, 9, 2)
    dtmMinutes = Mid(dtmLocalTime, 11, 2)
    dtmSeconds = Mid(dtmLocalTime, 13, 2)
Next 

Wscript.Echo dtmHour & ":" & dtmMinutes & ":" & dtmSeconds

This ist the call probe in DUDE:

array_element(execute("cscript.exe",concatenate("//NoLogo d:\dude\scripts\time.vbs ",device_property("FirstAddress")),"C:\WINDOWS\system32\"),1)

in 3.6 I get the text like hh:mm:ss

in 4 I get this error (see screenshot)


Maybe the syntax of the script calling was changed with version 4.x ?

Regards
Viktor
lnbsg05 - Remotedesktopverbindung_2012-02-17_14-50-53.jpg

[execute(“test.bat”,1,“c:\”)]
The command had to be separate from the path and you have to escape backslashes.

HTH,
Lebowski

Great ! Thanks dude!
it works now with this code:

array_element(execute("cscript.exe",concatenate("//NoLogo d:\\dude\\scripts\\time.vbs ",device_property("FirstAddress")),"C:\\WINDOWS\\system32\\"),1)

Regards
Viktor