Qlik Community

QlikView Deployment

Discussion Board for collaboration related to QlikView Deployment.

Not applicable

How to run a command-line command from QMC

Hi folks, I hope you'll forgive me if this is answered somewhere, but in searching the docs and the forums I've come up empty.

I've noticed a "Supporting Tasks" area under the System tab and thought I might be able to bring some of my batch jobs under the External Programs folder, which would make my life a little easier since I would have all my jobs in one place, the QMC.

I tried something simple for the Command line statement:

copy "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work.qvw.log" "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work2.qvw.log"

This works fine from the command line, but when I execute this job, it throws an error and quits.  Log follows:

(2012-08-24 17:01:43) Information: Starting task 'SD Ticket Copy'. Id:8e978564-b778-4900-8f2b-513aedef3e50. Triggered by 'ManualStartTrigger'. Id:00000001-0002-0003-0405-0607080a0b0c

(2012-08-24 17:01:43) Information: Entering Task Execution.

(2012-08-24 17:01:43) Information: ClusterID=1

(2012-08-24 17:01:43) Information: QDSID=8f6ce6a1-7e0a-2e51-243c-b8b98852e947

(2012-08-24 17:01:43) Information: TaskID=8e978564-b778-4900-8f2b-513aedef3e50

(2012-08-24 17:01:43) Information: MaxRunTime=1.00:00:00

(2012-08-24 17:01:43) Information: Max attempts:1

(2012-08-24 17:01:43) Information: Current Attempt=0

(2012-08-24 17:01:43) Information: Task Dependencies are OK

(2012-08-24 17:01:43) Information: Executing copy "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work.qvw.log" "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work2.qvw.log"

(2012-08-24 17:01:43) Information: Executing commandline: "copy "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work.qvw.log" "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work2.qvw.log"" in folder "C:\Windows\system32".

(2012-08-24 17:01:43) Error: Exception=System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified

(2012-08-24 17:01:43) Error:    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)

(2012-08-24 17:01:43) Error:    at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)

(2012-08-24 17:01:43) Error:    at SolutionGlobal.DOSExecute.ExecuteCommand(ILogBucket i_LogBucket, String i_Command)

(2012-08-24 17:01:43) Information: The process didn't start

(2012-08-24 17:01:43) Error: The task "SD Ticket Copy" failed. Exception:

(2012-08-24 17:01:43) Error: QDSMain.Exceptions.UnableToStartProcessException: The process didn't start.

(2012-08-24 17:01:43) Error:    at QDSMain.ExternalProgramTask.Execute(TaskResult taskResult)

(2012-08-24 17:01:43) Error:    at QDSMain.Task.AbstractTask.TaskExecution(ILogBucket logBucket, TaskResult taskResult)

(2012-08-24 17:01:43) Information: Task Execute Duration=00:00:00

(2012-08-24 17:01:43) Information: TaskResult.status=Finished

(2012-08-24 17:01:43) Information: Notifying all triggers of new state:FinishedWithErrors

(2012-08-24 17:01:43) Information: Notifying all triggers of new state:FinishedWithErrors - completed

(2012-08-24 17:01:43) Information: Saving Task Result


I'm kind of baffled, since this works from the command line manually, and these directories are where everything else lives.  Any ideas?

1 Solution

Accepted Solutions
Employee
Employee

Re: How to run a command-line command from QMC

Nick are you using copy "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work.qvw.log" "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work2.qvw.log" in the commandline box? You might setup a .bat file and then just try to run that. It would be helpful if you would put version and if you have publisher license.

Bill

4 Replies
Employee
Employee

Re: How to run a command-line command from QMC

Nick are you using copy "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work.qvw.log" "C:\ProgramData\QlikTech\SourceDocuments\Book of Work\Book of Work2.qvw.log" in the commandline box? You might setup a .bat file and then just try to run that. It would be helpful if you would put version and if you have publisher license.

Bill

Not applicable

Re: How to run a command-line command from QMC

Well, darned if that didn't work, Bill!  Thanx!   The funny thing was, that was where I was heading all along (putting the commands in a .bat file) but I wanted to check the syntax from the tool's perspective first.  Should have just shotgunned it in there.

So, can you tell me why it works from a script but not from the tool?  The code in the script is identical to what I had in the box, just cut and pasted.

The version, for prosterity's sake, is 11.0.11154.0, 64-bit and yes, I do have Publisher.

Employee
Employee

Re: How to run a command-line command from QMC

Hate to say it but I am not really sure. I have always do it using a .bat file because it was easier for me to make changes.

You can try (if you want to play with it) starting the command with  Cmd "c:\test.bat"

Bill

Not applicable

Re: How to run a command-line command from QMC

OK, thanx for the insite, Bill.  I guess this will be one of those cases where I just paraphrase my father and say, 'Because the software says so.  That's why."