problem with automating macro

eliquid

Serpwoo.com
May 10, 2007
7,207
205
63
A/B Testing
I got an odd problem I can not seem to figure out.

I got a macro/exe I built with jitbit.. runs perfectly fine on my home computers when I double click it. Also runs like a champ on task scheduler as well.

I decided to put it on a win2008 x64 box at rackspace and now I'm having issues. When I use RDP to connect to the box and login and double click the exe, it works fine. If I set task scheduler to run and I am actively watching it thru RDP, it runs fine too.

The area it start to fail is, if I disconnect from RDP and task scheduler runs it, task scheduler reports it was successful, but I know it wasn't because it is not collecting data ( its a web scraper ).

This issue isn't with just jitbit exe's, as ubot exe's do the same thing. I've tripled check everything I could and I the only variable is RDP. Everything works when I'm viewing it live on RDP, but doesn't run as expected when I disconnect/close RDP and check on it later.

Another example is one of the jitbit exe's open CMD prompt and types some commands in it and closes itself. This ran in task scheduler while I was off RDP and when I logged in with RDP, I seen the CMD prompt window open, but with no commands inserted into it. Again, this all runs fine double clicked or with task scheduler if I am viewing it all live thru RDP.

Does anyone have the same issue or clue to what is going on?

Thanks for any input you can give.
 


no way to know for sure, but are you scraping through a webbrowser or something? im thinking without RDP maybe something goes amiss when your bots try to locate windows on the screen if there is no screen connected.

edit: or tries to click on pos 100,105 or whatever, you get the idea.
 
yeah im hitting the x in the rdp top bar only... just x-ing out of it. When i reconnect ( only if just 1 minute after disconnect ) its making me log in at the log in screen.

No actual log off from the computer though
 
Ive been toying with it some and it seems that if I just leave the rdp open on my desktop the whole time, things run smooth and fine for hours.

The moment I close the rdp though, things stop
 
no way to know for sure, but are you scraping through a webbrowser or something? im thinking without RDP maybe something goes amiss when your bots try to locate windows on the screen if there is no screen connected.

edit: or tries to click on pos 100,105 or whatever, you get the idea.

Im not running a macro from my desktop thru the rdp to the server.. im running macros on the server itself. The RDP was just so I could watch it and make sure it was running as expected.
 
no way to know for sure, but are you scraping through a webbrowser or something? im thinking without RDP maybe something goes amiss when your bots try to locate windows on the screen if there is no screen connected.

edit: or tries to click on pos 100,105 or whatever, you get the idea.

I re-read this again and I think I know maybe where you are going..

In the example of my ubot exe, it does open up the browser ( inside itself ) and scrape, but my jitbit exe's are just opening up CMD console and doing various commands and are also effected.

In the case of the CMD console ones, the console opens but no text is entered. I caught this when it ran while I was off RDP and when I logged in to check it the console was open on the servers desktop doing nothing with no commands.

Again, these all run fine with RDP just left open, but I was thinking they should run fine with RDP closed/disconnected.
 
Running RDP to a server instance is different than being on the "console" of the windows box. Remote Desktop Protocol is used to connect to a windows server for remote management, etc. On the server side, when you setup a windows box, you put it in one of two modes. "Terminal Services mode" or "Remote Administration mode". When running applications, etc. through an RDP session, a user at the physical machine can still log in and operate the box normally (without seeing the applications running) in the Terminal Session.

I say all that to say, you might trying setting up VNC on the local machine so you can connect to the physical desktop session and not a terminal services session on the box. The other option is try to get your ubot stuff setup as a service and not running in the terminal service virtual session.

I did check IM before writing this but you weren't on. If you need more help, you know where to find me. :-)
 
Don't know if this is possible, but can you RDP to the machine, and then RDP to the machine again from itself, and run it through there, and just leave the second RDP open when you disconnect?

Ha, i have no clue but it might be worth a try.. if it works that would be awesome
 
I re-read this again and I think I know maybe where you are going..

In the example of my ubot exe, it does open up the browser ( inside itself ) and scrape, but my jitbit exe's are just opening up CMD console and doing various commands and are also effected.

In the case of the CMD console ones, the console opens but no text is entered. I caught this when it ran while I was off RDP and when I logged in to check it the console was open on the servers desktop doing nothing with no commands.

Again, these all run fine with RDP just left open, but I was thinking they should run fine with RDP closed/disconnected.

Your console program should run just fine if you're doing it command line (if you're running cmd.exe and then having your macro send keystrokes, that's a different deal though).

I really don't see any reason the macros shouldn't be working unless the mouse location is set to x-y coordinates and it was developed on a different machine than you're running it. If that's the case, edit your script to use control ID's instead.

Another thing to think about: If you are trying to script some web scraping, what has worked great for me in the past on Windows was using curl (curl.exe not the php library) and textpipe (curl for the initial GET and then textpipe for the parse/format). At least the script wouldn't be so dependent on screen macro activity and it will run a lot faster in silent mode.

I doubt connecting to localhost via RDP would ever work.
 
Your console program should run just fine if you're doing it command line (if you're running cmd.exe and then having your macro send keystrokes, that's a different deal though).

I really don't see any reason the macros shouldn't be working unless the mouse location is set to x-y coordinates and it was developed on a different machine than you're running it. If that's the case, edit your script to use control ID's instead.

Another thing to think about: If you are trying to script some web scraping, what has worked great for me in the past on Windows was using curl (curl.exe not the php library) and textpipe (curl for the initial GET and then textpipe for the parse/format). At least the script wouldn't be so dependent on screen macro activity and it will run a lot faster in silent mode.

I doubt connecting to localhost via RDP would ever work.

Yeah Jitbit opens CMD ( which works ) and then sends keystrokes to it to run certain commands ( not working when off RDP, but works when on RDP )

All the macros are set up to not use any x-y cord. stuff though..

its a bothersome prob though.

thanks for the insight
 
Running RDP to a server instance is different than being on the "console" of the windows box. Remote Desktop Protocol is used to connect to a windows server for remote management, etc. On the server side, when you setup a windows box, you put it in one of two modes. "Terminal Services mode" or "Remote Administration mode". When running applications, etc. through an RDP session, a user at the physical machine can still log in and operate the box normally (without seeing the applications running) in the Terminal Session.

I say all that to say, you might trying setting up VNC on the local machine so you can connect to the physical desktop session and not a terminal services session on the box. The other option is try to get your ubot stuff setup as a service and not running in the terminal service virtual session.

I did check IM before writing this but you weren't on. If you need more help, you know where to find me. :-)

^^^ this worked.

Josh was spot on with this. I went in and installed TeamViewer and set it as a windows service and rebooted the machine. Once back up I went in thru TeamViewer instead of RDP and set up a macro in Task Scheduler and exited TeamViewer. Couple minutes later I went thru TV and everything was running smooth and fine.

I sort of understand now what Josh ( testonej ) was saying, even though I dont fully 100% understand it.

Kudos to him and everyone else that chimed in though.