Sign in to follow this  
Followers 0
gigilihooie

Shortcut on desktop when disc inserted

2 posts in this topic

#1 ·  Posted (edited)

Well im trying to make a script when you input a disc into the drive, a shortcup pops up on the desktop. And when you take the disc out, it removes the shortcut (like in linux).

This is what I have so far.

$var = DriveStatus("G:\")
$D = DriveGetLabel("G:\")

while 1
If $var = "NOTREADY" Then
    FileDelete(@DesktopDir & "\" & $D & ".lnk")
Else
    If $var = "READY" Then
    FileCreateShortcut("G:\",@DesktopDir & "\" & $D & ".lnk")
    EndIf
EndIf
wend

It kind of works but it doesnt. The drive is set to G: but all the drives would be nice.

Any ideas?

Edited by gigilihooie

Share this post


Link to post
Share on other sites



Well im trying to make a script when you input a disc into the drive, a shortcup pops up on the desktop. And when you take the disc out, it removes the shortcut (like in linux).

This is what I have so far.

$var = DriveStatus("G:\")
$D = DriveGetLabel("G:\")

while 1
If $var = "NOTREADY" Then
    FileDelete(@DesktopDir & "\" & $D & ".lnk")
Else
    If $var = "READY" Then
    FileCreateShortcut("G:\",@DesktopDir & "\" & $D & ".lnk")
    EndIf
EndIf
wend

It kind of works but it doesnt. The drive is set to G: but all the drives would be nice.

Any ideas?

Incorporating some For...Nexts along with 2 dimesnsional arrays should do it.

For those who are asking questions, look in the help file first. I'm tired of people asking stupid questions about how to do things when 10 seconds in the help file could solve their problem.[quote name='JRowe' date='24 January 2010 - 05:58 PM' timestamp='1264381100' post='766337'][quote name='beerman' date='24 January 2010 - 03:28 PM' timestamp='1264372082' post='766300']They already have a punishment system for abuse.[/quote]... and his his name is Valik.[/quote]www.minikori.com

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