krzyrice Posted May 26, 2008 Share Posted May 26, 2008 (edited) How would you use this in a script? "@MyDocumentsDir" I've searched everywhere but can't find the answer. I'd like to create a shortcut for my program using autoit and would like to know how to place that into my documents folder. Please help me. Edited May 26, 2008 by krzyrice Link to comment Share on other sites More sharing options...
sandin Posted May 26, 2008 Share Posted May 26, 2008 (edited) maybe this: $FileExe = FileOpenDialog("select file", "C:\", "Executable (*.exe)") if @error = 1 then Exit ;cancel has been clicked $stringSplit = StringSplit ( StringTrimRight($FileExe, 4), "\") $count = $stringSplit[0] $ShortcutName = InputBox("Shorcut Name", "Input name of your new shortcut:", $stringSplit[$count]) if @error = 1 then Exit ;cancel has been clicked FileCreateShortcut($FileExe, @MyDocumentsDir & "\" & $ShortcutName & ".lnk") MsgBox(0, "Shortcut Creator", "New shortcut for your " & $stringSplit[$count] & " program has been created" _ & @CRLF & "Location: " & @MyDocumentsDir & "\" & $ShortcutName & ".lnk") Edited May 26, 2008 by sandin Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
rudi Posted May 26, 2008 Share Posted May 26, 2008 How would you use this in a script? "@MyDocumentsDir" I've searched everywhere but can't find the answer. I'd like to create a shortcut for my program using autoit and would like to know how to place that into my documents folder. Please help me. $FileName = "C:\FooBar.txt" $LinkName = "Link to FooBar.txt.lnk" $handle = FileOpen($FileName, 2) FileWriteLine($handle, "I'm just a file, leave me alone!") FileClose($handle) FileCreateShortcut($FileName, @MyDocumentsDir & "\" & $LinkName, @MyDocumentsDir) Run("explorer.exe /e,/select," & @MyDocumentsDir & "\" & $LinkName) Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
krzyrice Posted May 26, 2008 Author Share Posted May 26, 2008 thank you so much for the help!! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now