Sign in to follow this  
Followers 0
Guest kris_h

Running Script From Cdrom

12 posts in this topic

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..

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

... when you post code you should avoid posting serials.

Can you try copy the installation folder in the HHD and after starting the installation in order to solve the problem Larry posted.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

@autoitNOW: You also cannot be sure that C: is the drive where windows is installed... but this is no problem. Just use the macros @WorkingDir, @ScriptDir and so on.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

What is the specific error it gives?


Who else would I be?

Share this post


Link to post
Share on other sites

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!!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

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)

Share this post


Link to post
Share on other sites

@emmanuel:

I don't mean to hurt your feelings;

It's @TempDir not @temp

Share this post


Link to post
Share on other sites

@emmanuel:

I don't mean to hurt your feelings;

It's @TempDir not @temp

<{POST_SNAPBACK}>

:lol::(:ph34r: how'd I do that? :"> Thanks.

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0