M3HTA
M3HTA

Reputation: 9

Unable to run an autoit file from a vbscript when the pathname is provided using a variable

I want to call an autoit script from a vbs file while providing a variable for pathname of autoit script but it is not working..I have provided the code below.I am calling an autoit script called call.au3 which is in the same folder as the autoit script.Please tell me the changes I should do for the same.Thanks in advance :)

set WshShell = WScript.CreateObject("WScript.Shell")

logger= Left(WScript.scriptfullname,(Len(WScript.scriptfullname)-Len(WScript.scriptname)))

WshShell.run "AutoIt3.exe logger & "\call.au3""

Upvotes: 0

Views: 1100

Answers (1)

Ekkehard.Horner
Ekkehard.Horner

Reputation: 38745

  1. "is not working" is not working as a problem description. You should specify expected behavior/output, actual behavior/output, and error messages (if any)
  2. Your home made "get the path of the containing folder" expression does not return what the FSO method .GetParentFolderName(WScript.ScriptFullName) returns
  3. The .Run call will not pass one argument (full file spec of your script) to autoit, if the path contains spaces; to be on the save side, always quote (", aka "") pathes in command line arguments.

Upvotes: 2

Related Questions