4 Replies Latest reply: Aug 29, 2012 1:21 PM by Nick Svolos RSS

    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?