Comment #2 Saturday, February 25, 2006 9:33 PM
2|2|Cruzerlock 2|I:\Cruzerlock 2\Cruzerlock2.exe|n/a|n/a|n/a|n/a |
The bolded part is where it gets the main file from. Is there a way like in desktop x to have it launch from the exe directory.
2|2|Cruzerlock 2|%exedir%\Cruzerlock 2\Cruzerlock2.exe|n/a|n/a|n/a|n/a |
i tried it like this but it dosent work. i have the SD Shortcuts on my flash drive, and it has all my shortcuts on it. but when i plug it into another computer the file paths are different because its a different drive letter on another computer.
sorry i realy dont know how else to explain it.
Comment #3 Sunday, February 26, 2006 9:45 AM
Hi Jerry, It seems me you want too many from this small Button! (joke) The Button does not know what "%exedir%" is this .
So there are two ways to solve this problem:
1. The easy way: press in the Menu Settings the "Change Launch" command and enter the new path to a program that you want run from this Item.
2. The difficult way: you may add to the shortcut info a new parameter - "runfromflash" for example. Then you may add to the Button Script something like this:
Dim runfromflash,flash
Sub Object_OnStateChange(state)
If state="Command executed" Then
runfromflash=True '<== this is imitation of checking a given variable
GetFlashDrive
End If
End Sub
Sub GetFlashDrive
On Error Resume Next
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set allDrives = objFSO.Drives
'the prohibition on Floppy Drives checking
If objDrive<>"A:" And objDrive<>"B:" Then
For Each objDrive In allDrives
If objDrive.DriveType = 1 And objDrive.IsReady Then
'searching for available Removable drives
If LCase(objDrive.VolumeName) = "enter the name of your flash drive here" Then
'for entering the name use a little letters only
flash=objDrive
End If
End If
Next
End If
Set allDrives = nothing
Set objFSO = nothing
If runfromflash Then
RunProgram(flash&"\Cruzerlock 2\Cruzerlock2.exe")
End If
End Sub
Sub RunProgram(thepath)
On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
objShell.run (Chr(34)&thepath&Chr(34))
Set objShell = nothing
End Sub
However... This is not already a message but this is nearly an article.
Best Regards.
Comment #4 Sunday, February 26, 2006 3:22 PM
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading files.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!
Comment #1 Saturday, February 25, 2006 1:05 PM
Very useful!
Thank you.