0

We have an automation script which we run in Windows command prompt.

We use it like 'Automate task 1'

Now I am trying to run it using ruby. I followed this SO post. But since this is not a system command it doesn't get executed.

system('Automate task 1')

How do I excute such commands?

Note: We don't have access to type or source of that command nor knows where is the command stored. We just execute it in cmd.

Community
  • 1
  • 1
Sreeraj Chundayil
  • 5,548
  • 3
  • 29
  • 68
  • Enter the full path to the executable. – Carcigenicate Nov 02 '16 at 15:00
  • U didn't read my note. – Sreeraj Chundayil Nov 02 '16 at 15:00
  • "System command" doesn't mean much. but if whatever program you're trying to run is **NOT** findable via the underlying OS's $PATH, %PATH, etc... then you MUST provide the full absolute `/path/to/whatever/Automate` – Marc B Nov 02 '16 at 15:01
  • @InQusitive Then you'll need to add the path to it as an environmental variable. You have to specify the location somehow. – Carcigenicate Nov 02 '16 at 15:01
  • 1
    You don't know where the command is stored? Sounds like something you should figure out first. – Darkwater Nov 02 '16 at 15:02
  • @MarcB: There are many paths in my PATH variable, I know one of them is the automation path but don't know which. Still do I need to give the path in the ruby script? Can't it take from PATH variable/? Anyway it works in cmd. – Sreeraj Chundayil Nov 02 '16 at 15:03
  • @Darkwater: Consider I have the path , for eg: C:/scripts . Now how do I excecute it? system('C:\Scripts\Automate task 1') ?? – Sreeraj Chundayil Nov 02 '16 at 15:15
  • @InQusitive I have little experience with Ruby on Windows but I'd suspect so, yes. At least that's how it'd work on Linux. – Darkwater Nov 02 '16 at 15:17

0 Answers0