Kaseya Community

Execute, Shell vbscript

  • What Is Wrong with It?
    try to run a vsb script

    IF True
    THEN
    Get Variable
    Parameter 1 : 4
    Parameter 2 :
    Parameter 3 : cdrive
    OS Type : 0
    Write File
    Parameter 1 : #cdrive#test\tmps.vbs
    Parameter 2 : VSASharedFiles\tmps.vbs ; this work fine
    OS Type : 0
    Execute Shell Command
    Parameter 1 : %ComSpec% wscript #cdrive#test\tmps.vbs; ??
    Parameter 2 : 0
    OS Type : 0
    Delete File
    Parameter 1 : #cdrive#test\tmps.vbs
    OS Type : 0
    ELSE


    Test.vbs

    MsgBox "Hallo Kaseya Forum"

    Legacy Forum Name: Execute, Shell vbscript,
    Legacy Posted By Username: Humberto Guererero Obando
  • in a command line use cscript

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Benjamin.Lavalley@kaseya.com
  • do you mean something like Parameter 1 : %ComSpec% cscript C:\tmps.vbs?
    in place of
    Parameter 1 : %ComSpec% wscript #cdrive#test\tmps.vbs; ??

    Still not run the script

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Humberto Guererero Obando
  • Humberto Guererero Obando
    do you mean something like Parameter 1 : %ComSpec% cscript C:\tmps.vbs?
    in place of
    Parameter 1 : %ComSpec% wscript #cdrive#test\tmps.vbs; ??

    Still not run the script


    Drop "%ComSpec%"

    cscript \path\script.vbs works perfectly well.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Lmhansen
  • For your knowledge, the variable %comspec% launches a command prompt. The actual object it references is c:\windows\system32\cmd.exe and not a folder.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: SMason
  • cscript.exe is runing but the script still not run!
    Confused


    cscript.exe is runing as system and not as user

    Execute Shell Command
    Parameter 1 : cscript #cdrive#test\tmps.vbs
    Parameter 2 : 0

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: Humberto Guererero Obando