Jump to content

only work in cdrom ...??


AlienStar
 Share

Recommended Posts

hello everybody

we know all that there are some of games we can't run on hard desk only on cd/dvd rom

so in this situation we have to use virtual drive

now how can I let every script I make run just in cd/dvd rom ( can't run on hard desk if it was copied ) ???

thanks for all

Edited by AlienStar
Link to comment
Share on other sites

Add this to the front of your script.

If DriveGetType(StringTrimRight(@ScriptDir, StringLen(@ScriptDir) - 2)) <> "CDROM" Then Exit

btw, DriveGetType returns "CDROM" for CDs and DVDs, and maybe Blu-ray too, but I don't have a Blu-ray drive to test it on.

Edited by Hawkwing

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

I know if the script I'm making has links I can use this

$var = DriveGetType($Drive&"\") = "CDROM"

something like this : script to eject the drive which contain the script :

$drive = StringLeft(@ScriptFullPath,2) 
If DriveGetType($Drive&"\") = "CDROM" Then CDTray($Drive,"Open")

but if there are no links in how to make it ?

like this :

If ProcessExists("project.exe") = True Then
    MsgBox(64, 'Info', 'existed')
Else 
    MsgBox(64, 'Info', 'not existed')
EndIfn

???????????!!!!!!!!!!!!!

Edited by AlienStar
Link to comment
Share on other sites

Hi,

There is multiple things you could use to have the script to check itself when it's started.

DriveGetType()

DriveGetFileSystem()

FileGetAttrib()

Nothing will really stop a determined enough person from defying where the script is run from.

But it'll hold the novice user at bay.

Cheers

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