Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

VBScript and .bat files not working in QEMC

Hi,

I have a .vbs file that runs fine when double clicked but wont run from 'external programs' in Publisher.

.vbs file is at;

C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.vbs

Have tried the following statements in the command line;

1.) C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.vbs

2.) C:\Windows\SysWOW64\cscript.exe

C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.vbs

3.) C:\Windows\System32\cscript.exe

C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.vbs

4.) C:\Windows\SysWOW64\cscript.exe

"C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.vbs"

5.) C:\Windows\System32\cscript.exe

"C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.vbs"

I've also tried it with .bat files where the .bat file works if i double click it so tried.

6.) C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.bat

Most of these just give me a yellow warning sign on the qemc but ultimately don't do anything.

QEMC Program.bmp

Am i missing something important?

I've checked and the cScript.exe is in both those locations but it still doesn't work.

Regards,

Nick

7 Replies
Not applicable
Author

Have you seen if cscript is launched ?

Not applicable
Author

Thanks for getting back to me.

Having checked the log files, it seems it cannot find the folder for some reason;

14/08/2012 14:27:27.2809281InformationExecuting commandline: "\\Qlikview01\QLIKVIEW\vbs  Scripts\Daily Report Archive Script\Publisher Daily Report.bat" in folder "\\Qlikview01\QLIKVIEW".
14/08/2012 14:27:27.5461264ErrorException=System.ComponentModel.Win32Exception: The system cannot find the file specified

I can't figure out why it's only looking in "\\Qlikview01\QLIKVIEW" when the .bat file shows;

"cscript.exe "\\Qlikview01\QLIKVIEW\vbs Scripts\Daily Report Archive Script\Publisher Daily Report.vbs"

I read about the issue with Qlikview hosting on multiple servers (http://community.qlik.com/thread/53608) so have amended to show full UNC path.

If i try and run the .bat file from a different folder (with the script updated) i still get an error;

14/08/2012 09:38:23.8991948InformationExecuting commandline: "\\Qlikview01\QLIKVIEW\Automated_Reports\Scripts\Daily  Report Archive Script\Publisher Daily Report.bat" in folder "\\Qlikview01\QLIKVIEW\Automated_Reports\Scripts".
14/08/2012 09:38:23.9303948ErrorException=System.ComponentModel.Win32Exception: The system cannot find the file specified

It seems that the Information Line always chooses the wrong folder.

Any ideas why?

Regards,

Nick

Not applicable
Author

if you try to launch a .bat file, it will allway fail until you specify the cmd command.

a .bat or a .vbs file, are not really a program, that's why you have to tell the interpreter used with this kind of files.

try c:\windows\systme32\cmd.exe "C:\QLIKVIEW\Automated_Reports\Reports\Daily Report\Daily Report Archive Script\Publisher Daily Report.bat"

if you'll have to face difficulty with the space in the name of your file, try to use dir /x to know the name of you file or directory dos like.

hope it'll help you !

Not applicable
Author

Thanks very much.

I can now launch the bat file, however, it's not causing the .vbs file to perform it's task and it's showing a warning sign after execution.

The log file now shows;

14/08/2012 16:33:41.3911758InformationExecuting commandline: "C:\WINDOWS\system32\cscript.exe  "\\Qlikview01\QLIKVIEW\vbs Scripts\Daily Report Archive Script\Publisher Daily Report.bat"" in folder "C:\WINDOWS\system32".
14/08/2012 16:33:41.5627747WarningProcess exited with non zero exit code: 1 at 14/08/2012 16:33:41
14/08/2012 16:33:41.5627747InformationProcess exited with exit code: 1 at 14/08/2012 16:33:41
14/08/2012 16:33:41.5783746WarningThe task "Daily Report Archive" finished with warnings. WarningCount=1

Is there any way i can check where it's not working? If i run the .bat file without Publisher it performs as expected.

Thanks in advance,

Nick

Not applicable
Author

You should write at the beginning and end of your script flag file on your serveur.

You should also try to launch an atomic script with only writing on your serveur what you want to launch.

hope you'll find how to fix your problem !

Not applicable
Author

These steps work , you can adapt them  to watch how your process work:

Make two files :

One ".bat" named VBS.bat on c:\

One ".vbs" named TXT.vbs on c:\

Content of VBS.bat:

:Create_TXT

c:\TXT.vbs

exit

Content of TXT.vbs:

dim filesys, filetxt

Set filesys=CreateObject("Scripting.FileSystemObject")

Set filetxt=filesys.CreateTextFile("c:\File.txt", True)

filetxt.WriteLine("The message you wants")

filetxt.Close

Create an external task on your publisher lauching the following statement:

cmd.exe /C "c:\VBS.bat"

Then you will see that launching the task, create the file with your text

Important : When you try to encapsulate the lauching of a QVW application by VBS , be sure that the user of the QlikView's  services  have a named cal , and you've launched one time QlikView to chose the interface language !

Hope i'll help you to fix your bug

Not applicable
Author

Hello,

I have the same problem. Did you find a solution ?

Thank you in advance.