I have been running into a problem for the past few months with this VBScript not working 100% on every computer. It seems to be some Windows 10 and Windows 7 Ultimate that have the problem.
I have been using a workaround of a different VBScript with the change of instead of \DATA its just DATA. I have been trying to use error handling to just ignore the problem and run the other version of the code, but even with On Error Resume Next or Try Catch Finally statements, I still get the popup of cannot find the file.
I have also tried On Error GoTo error handling.
How do I make it try a path variation and not kick back any error msg then move to the next path option?
Set shell = CreateObject("Shell.Application")
Dim WshShell, InPath
Set WshShell = WScript.CreateObject("WScript.Shell")
InPath = WshShell.CurrentDirectory + "\DATA"
'shell.ShellExecute "application", "arguments", "path", "verb", window
shell.ShellExecute "Install.bat", , InPath, "runas", 1
Set shell = Nothing
WshShell.CurrentDirectory(both on systems where the code is working and systems where it's not working). - Ansgar Wiechers