Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I run a batch file from Access point

I have a requirement to run a batch file from Access point(Browser) in order to reload the qvw and Nprinting stuff, I'm able to run through using batch file separately but no idea on how to implement in Accesspoint.

Thanks,

Mahe

7 Replies
alexpanjhc
Specialist
Specialist

if you have nprinting on-demand, maybe you can create jobs/ tasks?

Not applicable
Author

I have Nprinting Designer where I already set jobs to run few reports, but here I have a specific requirement where user also do reload and generate reports.

It can be achieved thru Batch file but how can we accommodate this in Access point(Browser).

Thanks,'

Mahe

alexpanjhc
Specialist
Specialist

Do you have on-command installed on the server?

If you do, you can do it on accesspoint.

Not applicable
Author

if I have a batch file called "Test.bat", the code from Access would look like

call Shell ( Environ$ ( "COMSPEC" ) & " /c  c:\test.bat", vbNormalFocus) 

Environ$("COMSPEC") returns the path to Command.com on the machine and the "/c" argument makes sure that the Dos window is automatically closed when the batch file finishes executing.Copy the file Elevate.exe into a folder where Windows can always find it (such as C:/Windows). To use it in a batch file, just prepend the command you want to execute as administrator with the elevate command, like this:

  elevate net share ...nd it should run the command net share as administrator. Of course, it does not relieve the administrator from the duty to approve the request (unless you have enabled the quiet mode of UAC or disabled the UAC altogether).

The syntax of the Elevate command is as follows:

  elevate [-opt1] [-opt2...] [path\]file[.exe] [param1 [param2...]]

Where -optN can be one of the following:

  -?         - Display the help screen and exit

  -info      - Open the web page with more information (the web page you are reading now!) and exit

  -wait4idle - Wait for the target process to initialize before returning

  -wait4exit - Wait for the target process to finish before returning

  -noui      - Don't display any messages, even if an error occurs

After the options, the following arguments should be entered:

  file       - The file name of the program to launch elevated

  paramN     - Optional parameters (as expected by the program being launched)

For example, if for some reason you want to run Notepad as administrator, and continue only after you exit Notepad, you would use a command like this:

  elevate   -wait4exit   notepad

If you use the elevate command while being logged in to Windows as a user that does not have a split token, that is as a non-administrator or a guest user, it will ask for the administrator’s password to continue. If you use it as the true administrator (that is, if UAC is disabled, or it you’ve launched the batch file itself as administrator), then no administrator’s approval would be required and it would launch the program as usual.

Not applicable
Author

Hi Ashwin,

Where do I get Elevate.exe file and also how can I run execute windows batch file thru Access point(Qlikview)

Thanks,

Mahi

marcus_sommer

vikasmahajan

you can run the batch file through windows scheduler also see this link https://community.qlik.com/docs/DOC-5412

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.