Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Execute statement problem

hey there,

i need to execute a vbs file directly from the load script of QV.

my actual code is this one:

SET vCSCRIPT = c:\windows\system32\cscript.exe;

EXECUTE $(vCSCRIPT) C:\Documents and Settings\user\Desktop\VB\Delete_first_X_lines_cycle.vbs;

No errors are given but the file is not executing. The document has execute permissions and the vbs when manualy started works properly.

Any ideas?

Thnks in advance

JuanPedro

1 Solution

Accepted Solutions
marcus_sommer
Not applicable

Re: Execute statement problem

with quotas it works ...

SET vCSCRIPT = 'c:\windows\system32\cscript.exe';

EXECUTE $(vCSCRIPT) "C:\Documents and Settings\user\Desktop\VB\Delete_first_X_lines_cycle.vbs";

- Marcus

6 Replies
Not applicable

Re: Execute statement problem

Still not able to run .vbs with execute.

My momentary workaround is to execute a .bat file that runs the .vbs

I dont really like this solution so any hint is appreciated.

Have a nice day

Toni_Kautto
Not applicable

Re: Execute statement problem

The string that will be executed is below. Will it work if you execute it manually in a command prompt?

c:\windows\system32\cscript.exe C:\Documents and Settings\user\Desktop\VB\Delete_first_X_lines_cycle.vbs

I would guess that the path including white spaces would require quotes in order to be executable.

c:\windows\system32\cscript.exe "C:\Documents and Settings\user\Desktop\VB\Delete_first_X_lines_cycle.vbs"


Not applicable

Re: Execute statement problem

Try calling Call "functionname()" in .vbs file.  also try to pipe the output to some text file.

eg. cscript myScript.vbs >> c:\scriptslog\log.txt

kaushik_solanki
Not applicable

Re: Execute statement problem

Hi,

     Just try this.

     EXECUTE cscript C:\Documents and Settings\user\Desktop\VB\Delete_first_X_lines_cycle.vbs

Regards,

Kaushik Solanki

marcus_sommer
Not applicable

Re: Execute statement problem

with quotas it works ...

SET vCSCRIPT = 'c:\windows\system32\cscript.exe';

EXECUTE $(vCSCRIPT) "C:\Documents and Settings\user\Desktop\VB\Delete_first_X_lines_cycle.vbs";

- Marcus

Not applicable

Re: Execute statement problem

The quotes did the job!

usefull the log file aswell.

thnks everyone for your time and anserws

Have a nice day.