# Creating a process and/or executing a ruby script internally

**URL:** <https://www.ruby-forum.com/t/creating-a-process-and-or-executing-a-ruby-script-internally/126229>\
**Category:** Ruby\
**Created:** [January 16, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/creating-a-process-and-or-executing-a-ruby-script-internally/126229 "2008-01-16T15:28:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgarcia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/cc9497/32.png) [@sgarcia](https://www.ruby-forum.com/u/sgarcia)\
**Post date:** [January 16, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/creating-a-process-and-or-executing-a-ruby-script-internally/126229/1 "2008-01-16T15:28:00Z")

</div>

##this is my process create script

puts(‘hello im run create clicker’)  
$pid = Process.create(  
:app\_name =\> ‘ruby clicker.rb’,  
:creation\_flags =\> Process::DETACHED\_PROCESS  
).process\_id

at\_exit{ Process.kill(9,$pid) }

##this is script that is supposed to be the called process

begin  
autoit = WIN32OLE.new(‘AutoItX3.Control’)

loop do

autoit.ControlClick(“Microsoft Internet Explorer”,’’, ‘OK’)  
autoit.ControlClick(“Windows Internet Explorer”,’’, ‘OK’)  
autoit.ControlClick(“Security Information”,’’, ‘&Yes’)  
autoit.ControlClick(“Security Alert”,’’, ‘&Yes’)  
sleep(2)  
end

rescue Exception =\> e  
puts e  
end

* * *

In my trek in using WATIR, and building a tough framework for multi-user  
tests, I ran across the a couple of javascript alerts. Some researching  
has landed me upon this script, that basically creates a daemon of  
clicker.rb.

In any case, the problem I’m having has to do with the creating of the  
process. A random process is being created in place of where  
‘clicker.rb’ should be.  
I’ve checked the file name of the ‘clicker.rb’ script, and its as it  
should be; and when I run ‘clicker.rb’ it does its job just as it  
should.

The two files are in the same directory as well, I’ve pretty much got  
myself stumped as to why ‘clicker.rb’ is not being called. Does the  
error have to do with the syntax of my name? I tried inputting in the  
full file directory path, but maybe I did it wrong.

My requirements are also correct for both files.

Eh…any help would be greatly appreciated
