Qlik Community

QlikView Management

Discussion Board for collaboration on QlikView Management.

udaya_kumar
Valued Contributor

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?

Tags (2)
1 Solution

Accepted Solutions
vgutkovsky
Honored Contributor II

how to execute bat file in qlikview server (qmc)

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

13 Replies
vgutkovsky
Honored Contributor II

how to execute bat file in qlikview server (qmc)

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
Valued Contributor

how to execute bat file in qlikview server (qmc)

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
Valued Contributor

how to execute bat file in qlikview server (qmc)

Hello experts,

Anyone help me in this issue please

Employee
Employee

how to execute bat file in qlikview server (qmc)

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.

udaya_kumar
Valued Contributor

how to execute bat file in qlikview server (qmc)

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
Honored Contributor II

how to execute bat file in qlikview server (qmc)

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

Vlad

udaya_kumar
Valued Contributor

how to execute bat file in qlikview server (qmc)

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
Valued Contributor

how to execute bat file in qlikview server (qmc)

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
Valued Contributor

how to execute bat file in qlikview server (qmc)

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?

Community Browser