开发者

Batch Scripts - Need to specify to use an ANSI console and execute a command

开发者 https://www.devze.com 2023-02-09 15:02 出处:网络
This is a noob question at its best but Google isn\'t finding what I need. I have a ruby script that I need to fire off via task scheduler.I thought I did it right by using the following:

This is a noob question at its best but Google isn't finding what I need.

I have a ruby script that I need to fire off via task scheduler. I thought I did it right by using the following:

cmd /k ruby test.rb

This works when starting the .bat file from the folder. However, if it runs from taskeng.exe it fails because its looking in my system32 folder. I don't want it to run from system32 so how do i format this to run from say, c:/dev/

Again, sorry for the extremely noob que开发者_运维问答stion.


You can leave out cmd of that and just use

ruby test.rb

or rather (in your case):

ruby C:\Users\Foo\test.rb

or something like that. Giving the complete path to the script usually helps in finding it ;-)

In any case, if you need the working directory you can set it in the scheduled task itself. Something akin to the following:

       

Batch Scripts - Need to specify to use an ANSI console and execute a command

Likewise, if you actually need cmd in there. Just fill out the Start in field and you have a working directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号