Sign in to follow this  
Followers 0
AlienStar

only work in cdrom ...??

6 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



DriveGetType


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

thanks Hawkwing

it works waw

thanks again so much and Skruge too

:D:D:D

Share this post


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

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