Jump to content

Running Script From Cdrom


Guest kris_h
 Share

Recommended Posts

Guest kris_h

i have made a script that will run fine from my hdd, when i burn and try to run the same script from a cd/dvd it doesnt work.

what am i doing wrong? or am i just retarted..

Link to comment
Share on other sites

Guest kris_h

script is compiled, doesn't rely on a drive letter and OS is XP pro...

; AutoIt Version: 3.0

; Language:      English

; Platform:      Win9x/NT

; Author:        kris

;

; Script Function:

;  types in cd key for bf1942

;WinMinimizeAll()

Sleep(1000)

; Run silent install

Run("setup.exe -s -sms")

; Wait for the app to become active

WinWaitActive("CD Serial Number Request")

; Now that the window is active, type cd key

Send("9915382068119711441426{ENTER}")

;Sleep(100)

; Wait for the app to become active

WinWaitActive("Electronic Registration")

; Now that the window is active

WinKill("Electronic Registration", "")

Sleep(3000)

ProcessClose("Battlefield 1942_eReg.exe")

; Finished!

Link to comment
Share on other sites

You need to have your script do the following to run from a CD:

. When you click on your compiled exe, have it copy files to a specific locaton. filecopy... to c:\temp, for example

. Then have that exe or another exe (I've noticed it works better to have 2 exe to do this, especially with a floppy), run the files from the set location on your hdd. Like say c:\temp, for example. runwait... c:\temp\"your file".

. You can then delete the temp file when the operation is complete.

The problem with trying to run from a CD is you can't predict what drive letter every computer is going to have, but you can copy the files from the CD to a specific location on your hdd and be sure they can run from there.

An ADVOCATE for AutoIT
Link to comment
Share on other sites

You also cannot be sure that C: is the drive where windows is installed...

<{POST_SNAPBACK}>

You can't even count on C:\ existing on all systems, or being writable if it does exist.

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Guest kris_h

If you use a DOS prompt and go to that drive and run the "setup.exe -s -sms" does it work?

Does running setup in this way require the ability to write to the place where it comes from. maybe the setup is trying to write to the CD... a log or something...

Lar.

<{POST_SNAPBACK}>

all sorted!! it was trying to write a log. so i added /f2c:\inst.log and now it runs.

Cheers!!

Link to comment
Share on other sites

all sorted!! it was trying to write a log. so i added /f2c:\inst.log and now it runs.

Cheers!!

<{POST_SNAPBACK}>

you might want to do that as
/f2"& @tempdir & "\inst.log"
just in case of the OS being installed on d: or some such (like this laptop I'm working on now, dual boot)

@SlimShady - THANKS! :ph34r: That's what I get for not looking at the helpfile, heh.

Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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