Jump to content

I need some help with a script BAD!


Recommended Posts

This is a repost, but I couldn't edit my topic on the last post. Sorry. I wanted to add the paypal info to the title.

Ok guys, I'm a total newb and have only created one Autoit script which was pretty basic. But now I need a script, and I need it BAD. I simply don't have time to do this manually. I have to automate the process.

Anyway, here is what I need the script to do:

I have a file called test.bpi (can be open and edited with notepad). In that file I need to search for all instances of a word (example: computer1) and replace it with the current computer name. Once that's done, I need to save it (with the same file name as it started with). The next thing the script needs to do is to kick off a cmd file (example: test2.cmd). The thing is, I need to execute it from a command prompt and it has to wait 10mins before it kicks off the next two cmd files. After each command file, I'd like it to wait 10mins before kicking off the next. And finally, once the last cmd file has run and the script has waited 10mins, I'd like for it to reboot the machine.

So basically the script layout looks like this:

1. Find word in file test.bpi, save it.

2. run test2.cmd from command prompt, wait 10mins.

3. run test3.cmd from command prompt, wait 10mins.

4. run test4.cmd from command prompt, wait 10mins.

5. reboot

I think it is easy for someone that is really good with AutoIt to do this. Actually, I'm sure this would be pretty easy for some. But I've never done programming in my life, so I don't even know where to start with this thing. Anyway, If you guys can help me out, I'd be VERY appreciative! smile.gif

Thanks!

Edit: Oh, I'm using AutoIt v2.

Whoever is the first person to write a working script (using AutoIt v2 or 3 that I can compile as an exe) that satisfies the above criteria by May 1st, 2005, I'll paypal them $20. I think this is easy for the pros so it can be a quick $20 for you. :(

Thanks again guys!!!

Edited by reload05
Link to comment
Share on other sites

Hi Reload05. This is done in Autoit 3.1.0, so if you can download and install that, you should be able to use this script. you will have to change the paths to the files, but I think this should do what you need. I won't be on here for another couple hours, but if you have any problems\questions let me know and I will try to get back to you. Hope it works for you!! Let me know how you make out....if it does work, don't worry about the $20.....I just wanted to see if I could help. here is the code:

#Include <process.au3>

AutoItSetOption("WinTitleMatchMode", 2)

run("notepad c:\test.bpi")

winwaitactive("Notepad")

sleep(500)

send("{CTRLDOWN}h{CTRLUP}")

winwaitactive("Replace")

send("computer1{TAB}" & @computername)

ControlClick("Replace", "", "Replace &All")

sleep(2000)

ControlClick("Replace", "", "Cancel")

send("{CTRLDOWN}s{CTRLUP}")

winclose("Notepad")

runwait("c:\test2.cmd")

sleep(600000)

runwait("c:\test3.cmd")

sleep(600000)

runwait("c:\test4.cmd")

sleep(600000)

shutdown(2)

Link to comment
Share on other sites

byteme you are AWESOME! I think you got it! PLEASE pm me with your paypal account info. I'll get the funds to you ASAP! I'm REALLY excited!

Edit: Dude, you gotta take the 20 bucks. This REALLY helped me out!

Edited by reload05
Link to comment
Share on other sites

byteme you are AWESOME! I think you got it! PLEASE pm me with your paypal account info. I'll get the funds to you ASAP! I'm REALLY excited!

Edit: Dude, you gotta take the 20 bucks. This REALLY helped me out!

<{POST_SNAPBACK}>

If you really want to donate $20, why not give it to AutoIt ? (www.autoitscript.com and click on the left on paypal).

Or help AutoIt by buying an authentic AutoIt mug or Mousepad (http://www.cafeshops.com/autoit).

That would benefit all of us.

Regards,

-Sven

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...