ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Change Desktop Folder

<< < (2/11) > >>

apfel:
Would the location to change it to be a static list of folders, or would it be a different location each time?
-belkira (November 09, 2007, 12:32 PM)
--- End quote ---
Er,... A function to add/edit diffrent Desktop Folders to right-click menu of tray icon.
What do you mean with diffrent location each time?

belkira:
What do you mean with diffrent location each time?
--- End quote ---

Basically, I could hard code a set of locations so you would just click on that location and that would become the new desktop folder.

belkira:
Something like this, just edit the ini file created with the paths you want.


--- ---;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
;
;
; Script Function:
; Change the location of the Default Desktop Folder through right-click menu on the systray icon.
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
#Persistent
Regread, current, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop
GoSub,INIREAD
GoSub,TRAYMENU

INIREAD:
IfNotExist,%A_ScriptName%.ini
{
  IniWrite,%current%,%A_ScriptName%.ini,Locations,dir1
  IniWrite,Location 2,%A_ScriptName%.ini,Locations,dir2
  IniWrite,Location 3,%A_ScriptName%.ini,Locations,dir3
  IniWrite,Location 4,%A_ScriptName%.ini,Locations,dir4
}
IniRead,dir1,%A_ScriptName%.ini,Locations,dir1
IniRead,dir2,%A_ScriptName%.ini,Locations,dir2
IniRead,dir3,%A_ScriptName%.ini,Locations,dir3
IniRead,dir4,%A_ScriptName%.ini,Locations,dir4
Return




TRAYMENU:

Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,%current%,CURRENT
Menu,Tray,Add,
Menu,Tray,Add,"%dir1%",DIR1
Menu,Tray,Add,"%dir2%",DIR2
Menu,Tray,Add,"%dir3%",DIR3
Menu,Tray,Add,"%dir4%",DIR4
Menu,Tray,Add,
Menu,Tray,Add,Edit,EDIT
Menu,Tray,Add,Reload,RELOAD
Menu,Tray,Add,
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Tip,%A_ScriptName%
Menu,Tray,Check,%current%
Return

CURRENT:

DIR1:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir1%
Reload
Return

DIR2:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir2%
Reload
Return

DIR3:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir3%
Reload
Return

DIR4:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %dir4%
Reload
Return

EDIT:
Runwait,%A_ScriptName%.ini
Return

RELOAD:
Reload

EXIT:
ExitApp

apfel:
Could you eyplain, how to use it or to compile into a exe?
I never used AutoHotKey scripts before.

belkira:
Sure, sorry.....To use it as is you will need to install AHK. then copy/paste the code into notepad or whatever editor you like and save it as something.ahk. Then just double click on that file to run it.

To use it, just right click on its tray icon and select which of the 4 paths you want to be used as your "Desktop"

To use the exe just download and double click.

The ini file looks like this:

--- ---Locations]
dir1=%USERPROFILE%\Desktop
dir2=Location 2
dir3=Location 3
dir4=Location 4

Just change locations 2-4 to be whatever location you want. Then reload the script.
There is a reload option on the right click menu.

Let me know if you need more clarification.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version