forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


CD Autorunner

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code
View previous topic :: View next topic  
Author Message
Dr. Dread
Professional Member
Professional Member


Joined: 03 Aug 2001
Posts: 1065
Location: Copenhagen, Denmark

PostPosted: Tue Aug 13, 2002 1:40 pm    Post subject: CD Autorunner Reply with quote

Did you (like me Wink ) disable the autorun feature for CD-ROM drives? This little util will let you autorun CDs
when YOU want it.

Two modes:
Full auto: Runs any autorun items found, no questions asked
List click: User has to click an item in the list of items found to launch it.

Greetz
Dr. Dread

Code:

TITLE CD Autorunner   .. by Dr. Dread
DIALOG CREATE, "CD Autorunner",-1,0,350,150
  OPTION SCALE,96
  OPTION DECIMALSEP,"."
  DIALOG ADD,STYLE,Normal,Arial,10,B,,BLACK
  DIALOG ADD,STYLE,Red,Arial,10,,RED
  DIALOG ADD,STYLE,Green,Arial,10,,LTGREEN
  DIALOG ADD,TEXT,drives,5,10,,,Choose action ..,Normal
  DIALOG ADD,RADIO,mode,2,268,72,50,Action,Full auto|List click,,CLICK
  DIALOG SHOW

:EVLOOP
  WAIT EVENT
  goto @event()

:modeCLICK
if @equal(@dlgtext(mode),Full auto)
  %%mode = full
else
  %%mode = click
end

:go
  %%driveletters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  %x = 0
  list create,1
  REPEAT
    %x = @succ(%x)
   %%letter = @substr(%%driveletters,%x,)
   %%drive = @volinfo(%%letter,T)
    if @equal(%%drive,"CD-ROM")
       list add,1,%%letter:
      %%cdrom = %%cdrom","%%letter
    end
  UNTIL @greater(%x,26)

  if @equal(@substr(%%cdrom,1,),",")
    %%cdrom = @strdel(%%cdrom,1,)
  end
  if @equal(@substr(%%cdrom,@len(%%cdrom),),",")
    %%cdrom = @strdel(%%cdrom,@len(%%cdrom),)
  end

  dialog set,drives,CD-ROM drives detected: %%cdrom
  gosub autorun
  if @null(%%run)
    DIALOG ADD,TEXT,record1,32,10,,,,Red
    dialog set,record1,No Autorun items found!
  else   
    DIALOG ADD,TEXT,record2,32,10,,,,Green
   DIALOG ADD,LIST,lister,54,10,330,95,CLICK
   list assign,lister,2
    dialog set,record2,Autorun items found:
  end
  goto evloop

:listerCLICK
  %%clicked = @item(lister)
  directory change,@path(%%clicked)
  RUN %%clicked
  goto evloop

:CLOSE
  EXIT

REM ################## SUBs #####################3
:autorun
  list create,2
  list seek,1,0
  repeat
    %%item = @next(1)
   if @file(%%item\autorun.inf)
     INIFILE OPEN,%%item\autorun.inf
     %%run = @iniread(autorun,open)
     if @equal(%%mode,full)
       if @file(%%item\%%run)
         directory change,%%item\
         RUN %%item\%%run
        list add,2,%%item\%%run
       end
      else
        list add,2,%%item\%%run
     end
   end
  wait
  until @equal(@index(1),@count(1))
exit

_________________
~~ Alcohol and calculus don't mix... Don't drink and derive! ~~

String.DLL * advanced string processing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 3 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group