Stretch Posted September 20, 2007 Posted September 20, 2007 Hey Ive got an update that runs from a CD. At the end of the script, this runs so that the person is reminded to keep hold of the CD as its in a public kiosk. If @Compiled Then CDTray(StringLeft(@ScriptFullPath, 2), "open") Windows errors because the exe thats running has been ejected. Any ideas of a neat way to overcome this?
BrettF Posted September 20, 2007 Posted September 20, 2007 Hey Ive got an update that runs from a CD. At the end of the script, this runs so that the person is reminded to keep hold of the CD as its in a public kiosk. If @Compiled Then CDTray(StringLeft(@ScriptFullPath, 2), "open") Windows errors because the exe thats running has been ejected. Any ideas of a neat way to overcome this?Make the CD copy itself to hard drive? When CD is ejected, have it self destruct? Self destruction has been achieved before if i remember rightly. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Stretch Posted September 20, 2007 Author Posted September 20, 2007 Could do, but speed is the issue here to reduce down time.... Its a full 600mb cd and would take a while to copy to the hard drive. There must be another way....
Dryden Posted September 20, 2007 Posted September 20, 2007 u don't need to copy the entire content of the CD... Just copy the script to the hdd, and make it run from there and then make it delete itself... "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett.
Shevilie Posted September 20, 2007 Posted September 20, 2007 Copy a small selfdestruct script.. that exists the cd-drive.. So the large script copys a small script to the harddrive.. Runs the small script and exit.. Then the small script ejects the cd and selfdestruct Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit
Dryden Posted September 20, 2007 Posted September 20, 2007 BTW if u need a self destruckt that use this: Func _Apaga($iDelay = 0) Local $sCmdFile FileDelete(@TempDir & "\scratch.bat") $sCmdFile = 'ping -n ' & $iDelay & '127.0.0.1 > nul' & @CRLF _ & ':loop' & @CRLF _ & 'del "' & @ScriptFullPath & '"' & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'del ' & @TempDir & '\scratch.bat' FileWrite(@TempDir & "\scratch.bat", $sCmdFile) Run(@TempDir & "\scratch.bat", @TempDir, @SW_HIDE) EndFunc All u have to do Is call the function _Apaga() and it will delete itself, so be shure to call it after u eject the CD. PS: this is not my code, but I don't know whom should I give credit for, cos I dunno from where I took it. So credit goes to whoever did it... :S "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now