Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
udaya_kumar
Specialist
Specialist

how to execute bat file in qlikview server (qmc)

Hi,

I tried executing bat file in the external programs in the supporting task in system tab.

but am not able to run the task, task is failed.

i gave like

"C:\Documents and Settings\SVC-QVEDX-D\Desktop\testrun.bat" in command line statement in the task.

and inside the bat file, i gave "cscript C:\Documents and Settings\SVC-QVEDX-D\Desktop\sample.vbs". but

i am getting error when i run this bat file that

"C\Documents and Settings\SVC-QVEDX-D\Desktop" the path specified not found.

so what could be the problem?

1 Solution

Accepted Solutions
vgutkovsky
Master II
Master II

Since you have 2 servers, you need to specify the UNC path when executing the BAT file. When Server 2 calls the C: drive, it's trying to call its own C: drive. For simplicity, even use the UNC path when executing from Server 1. If the service account on both servers is an administrator on the servers, you'll be able to use the admin $ share without having to explicitly share out a folder. Under supporting tasks, the BAT file should be referenced as:

" \\server1name\c$\Documents and Settings\SVC-QVEDX-D\Desktop\testrun.bat " (no spaces before or after the quotes)

Inside the BAT file, specify the VBS command as:

cscript " \\server1nam\c$\Documents and Settings\SVC-QVEDX-D\Desktop\sample.vbs " (no spaces before or after the quotes)

Vlad

View solution in original post

13 Replies
vgutkovsky
Master II
Master II

I think the problem is that the cscript command in the BAT file doesn't have quotes around the file path. Try this instead:

cscript "C:\Documents and Settings\SVC-QVEDX-D\Desktop\sample.vbs"

Regards,
Vlad

udaya_kumar
Specialist
Specialist
Author

hi vlad,

i have given the path like this only in bat file

cscript "C:\Documents and Settings\SVC-QVEDX-D\Desktop\sample.vbs"

but also its giving that error

udaya_kumar
Specialist
Specialist
Author

Hello experts,

Anyone help me in this issue please

Bill_Britt
Former Employee
Former Employee

For testing propose I always run the VB scripts and Bat files from the root of the "C" drive. The service account my not have permissions to access the C:\Documents and Settings\SVC-QVEDX-D\Desktop location.

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
udaya_kumar
Specialist
Specialist
Author

Hi Bill,

I tried giving the path like C:\testrun.bat, but also its giving error

that System cannot find the path specified

but the path exists, i dont know why it is giving error like this..

vgutkovsky
Master II
Master II

Per Bill's suggestion, you should also change the line in the .BAT file to: cscript c:\sample.vbs

Vlad

udaya_kumar
Specialist
Specialist
Author

hi vlad,

i gave it like that only cscript c:\sample.vbs inside the bat file.

and in command line statement in the task in qmc, i gave it as c:\testrun.bat

but its giving error telling that the system cannot find the file specified.

dont know y its giving error like this.

udaya_kumar
Specialist
Specialist
Author

I have qlikview server in two environment.

one server at server1 and second server at server2.

at server1 it works fine, but at server2 it's not working. dont know what need to be done at server2 to make it work.

udaya_kumar
Specialist
Specialist
Author

And am running this bat file using runas command.

i am using runas and opening an internet explorer and then am running that task.

i have only one drive C Drive, i think is there any problem of accessing the file in C Drive by this user?