Welcome Guest.   Make a donation to an author on the site November 24, 2014, 09:07:16 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2013! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 [2] 3 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Change Desktop Folder  (Read 31690 times)
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #25 on: November 12, 2007, 11:25:03 AM »

Is WorkDeskXP in english?
Logged
psionics
Participant
*
Posts: 116


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #26 on: November 13, 2007, 04:05:48 AM »

yes..  smiley

but still.. not the one i'm looking for..
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #27 on: November 20, 2007, 03:08:57 PM »

I have also been experimenting with this code, to see if I could get something useful.
But nevertheless, it seems I am stuck with three problems.
1) sometimes multiple desktop refreshes are needed.
2) after having refreshed the desktop, another refresh (f5 etc) is needed to see changes - for instance copying and deleting files on the desktop
3) icon positions are not saved
I have tried to use other methods of writing to the registry and also other methods of refreshing the desktop.

Has anyone got any further?
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #28 on: November 21, 2007, 01:29:15 AM »

Got a new idea which doesn't involve registry editing. It works, but I hadn't had time to test further yet if it solves any problems.
The idea is to use the subst command to create a virtual drive.
For instance: subst k: "C:\Documents and Settings\username\Desktop
This creates a drive which points to the usual Desktop folder.
Then I can just let the desktop folder location be drive k:
If I want to switch desktop folder, then I just delete virtual drive k:
subst k: /d
and create a new one pointing on another folder:
subst k: "C:\Documents and Settings\username\anotherDesktopFolder
Logged
belkira
Member
**
Posts: 52



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #29 on: November 21, 2007, 01:38:25 PM »

To go along with inshadow, I have tried his idea and it works great. I have not had any time to try to put it into a program yet, but if you want to see how it works you can do this.

Change the registry so it points to say....k: for the desktop folder then maybe create a batch file that has the following in it:
subst k: /d
subst k: "whatever folder"

Using it this way will require a logoff/on.

I would create a couple of those batch scripts and put different destination folders. After the initial logoff/on all that is required after running the batch file is to press F5

I will see if I can get a minute to throw a script together unless someone beats me to it....
Logged
belkira
Member
**
Posts: 52



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #30 on: November 21, 2007, 06:35:13 PM »

Well, in theory this should work, but it is untested so who knows.....

I am still unsure about the refresh method, and looking for something more reliable.

[copy or print]
;
; 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
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, Z:\
runwait, %comspec% /c subst Z: "`%USERPROFILE`%\Desktop",,Hide
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
GoSub,INIREAD
GoSub,TRAYMENU

INIREAD:
IfNotExist,%A_ScriptName%.ini
{
  IniWrite,Location 1,%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
  IniWrite,`%USERPROFILE`%\Desktop,%A_ScriptName%.ini,Locations,Default
}
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
IniRead,default,%A_ScriptName%.ini,Locations,Default
Return




TRAYMENU:

Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,Desktop Switcher, 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,Default,DEFAULT
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:
runwait %comspec% /c subst Z: /d,,Hide
runwait %comspec% /c subst Z: %dir1%,,Hide
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Return

DIR2:
runwait %comspec% /c subst Z: /d,,Hide
runwait %comspec% /c subst Z: %dir2%,,Hide
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Return

DIR3:
runwait %comspec% /c subst Z: /d,,Hide
runwait %comspec% /c subst Z: %dir3%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Return

DIR4:
runwait %comspec% /c subst Z: /d
runwait %comspec% /c subst Z: %dir4%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntÃ…, 0)
Return

DEFAULT:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %default%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntÃ…, 0)
ExitApp
Return

EDIT:
Runwait,%A_ScriptName%.ini
Return

RELOAD:
Reload

EXIT:
ExitApp

* Desktop Folder Switcher.exe (210.8 KB - downloaded 295 times.)
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #31 on: November 22, 2007, 02:51:10 PM »

changed:
runwait %comspec% /c subst Z: %dir1%,,Hide
to:
runwait %comspec% /c subst Z: "%dir1%",,Hide

[copy or print]
;
; 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
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, Z:\
runwait, %comspec% /c subst Z: "`%USERPROFILE`%\Desktop",,Hide
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
GoSub,INIREAD
GoSub,TRAYMENU

INIREAD:
IfNotExist,%A_ScriptName%.ini
{
  IniWrite,Location 1,%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
  IniWrite,`%USERPROFILE`%\Desktop,%A_ScriptName%.ini,Locations,Default
}
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
IniRead,default,%A_ScriptName%.ini,Locations,Default
Return




TRAYMENU:

Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,Desktop Switcher, 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,Default,DEFAULT
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:
runwait %comspec% /c subst Z: /d,,Hide
runwait %comspec% /c subst Z: "%dir1%",,Hide
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Return

DIR2:
runwait %comspec% /c subst Z: /d,,Hide
runwait %comspec% /c subst Z: "%dir2%",,Hide
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Return

DIR3:
runwait %comspec% /c subst Z: /d,,Hide
runwait %comspec% /c subst Z: "%dir3%"
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
Return

DIR4:
runwait %comspec% /c subst Z: /d
runwait %comspec% /c subst Z: "%dir4%"
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntÃ…, 0)
Return

DEFAULT:
RegWrite, REG_EXPAND_SZ, HKCU, Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders, Desktop, %default%
DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntÃ…, 0)
ExitApp
Return

EDIT:
Runwait,%A_ScriptName%.ini
Return

RELOAD:
Reload

EXIT:
ExitApp
Logged
perlguy
Charter Member
***
Posts: 30


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #32 on: November 23, 2007, 12:33:33 AM »

Rather than use up a drive letter with subst, I chose to use junction.exe (from sysinternals) to delete/create junctions when selecting a new desktop.

It's not polished (e.g. no code to setup inital desktops, no detection of current desktop to indicate on the tray menu), but it works where the registry edit/refresh code wasn't working for me (XP SP2).

* desktop switcher.ahk (1.78 KB - downloaded 276 times.)
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #33 on: November 23, 2007, 01:24:28 AM »

Rather than use up a drive letter with subst, I chose to use junction.exe (from sysinternals) to delete/create junctions when selecting a new desktop.
That requires a NTFS partition right?
I can see that my harddrive is formattet as NTFS. Is this standard today for Windows XP and up?

/Stig
Logged
perlguy
Charter Member
***
Posts: 30


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #34 on: November 23, 2007, 03:07:58 PM »

Yes, NTFS is default/standard these days...  one not so nice side effect using this method (so far) is that files copied/saved directly to the desktop folder don't show up immediately.  if you drag-n-drop to the desktop they do.

Also, the icons will auto-arrange, and sort, every time you switch desktops... so this may not be the solution for everyone... so far I like it, but only time will tell if the annoyances outweigh the benefits.

Right now, I'm just using it to split up downloads from everything else.  But I can definitely see using it for keeping project related files all together and at my fingertips.  Thank you to whoever started the thread!

Oh, one other thing - I use windows powerpro too, and used its context/contextfolder menu feature to create "Move To Desktop -> 1/2/3/4" context menus to move files between desktops, since copy/switch/paste doesn't work (for obvious reasons - you're changing the desktop folder in the middle of the operation).

If anyone knows how to do that with AHK, I'd sure appreciate a pointer/link.  I also pinged mouser on ContextMenu Commander status. smiley
Logged
perlguy
Charter Member
***
Posts: 30


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #35 on: November 24, 2007, 01:45:36 AM »

Ok, cleaned up, refactored the bits that do all the real work into a function...  In addition to the menu, I set Win+1/2/3/4 as hotkeys as well.  Changed to pickup the user's profile directory from the environment.  Registry is used to remember which desktop is current between sessions, and if restarting the script.

The only thing missing is a routine to do the initial setup... you need to move your current %USERPROFILE%\Desktop to %USERPROFILE%\Desktop1, create %USERPROFILE%\Desktop2 thru 4, and then run junction.exe manually to point Desktop to Desktop1.  I thought it might be best for anyone wanting to use this to understand how junction.exe works, rather than just doing it for them.

For me, having the ini seemed overkill, so I left out those bits.

[copy or print]
;
; 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

HotKey, #1, DIR1
HotKey, #2, DIR2
HotKey, #3, DIR3
HotKey, #4, DIR4

SetDesktop(N){
  EnvGet, PROFILE, USERPROFILE
  RegWrite, REG_SZ, HKCU, Environment, DESKTOP, %N%
  RunWait, junction.exe Desktop Desktop%N%,%PROFILE%,Hide
  DllCall("Shell32\SHChangeNotify", UInt, 0x08000000, UInt, 0, UIntP, 0, UIntP, 0)
  Loop 4 {
    Menu,Tray,Uncheck,Desktop &%A_Index%
  }
  Menu,Tray,Check,Desktop &%N%
}

TRAYMENU:
Menu,Tray,NoStandard
Menu,Tray,DeleteAll
Menu,Tray,Add,Desktop &1,DIR1
Menu,Tray,Add,Desktop &2,DIR2
Menu,Tray,Add,Desktop &3,DIR3
Menu,Tray,Add,Desktop &4,DIR4
Menu,Tray,Add,&Reload,RELOAD
Menu,Tray,Add,E&xit,EXIT
Menu,Tray,Tip,%A_ScriptName%

RegRead, DESKTOP, HKCU, Environment, DESKTOP
If (ERRORLEVEL = 1 or !DESKTOP)
  DESKTOP=1
SetDesktop(DESKTOP)
Return

DIR1:
SetDesktop(1)
Return

DIR2:
SetDesktop(2)
Return

DIR3:
SetDesktop(3)
Return

DIR4:
SetDesktop(4)
Return

RELOAD:
Reload
Return

EXIT:
ExitApp
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #36 on: November 24, 2007, 03:48:30 AM »

Ok, cleaned up, refactored the bits that do all the real work into a function...  In addition to the menu, I set Win+1/2/3/4 as hotkeys as well.  Changed to pickup the user's profile directory from the environment.  Registry is used to remember which desktop is current between sessions, and if restarting the script.
Great. Clever enough.

The only thing missing is a routine to do the initial setup... you need to move your current %USERPROFILE%\Desktop to %USERPROFILE%\Desktop1, create %USERPROFILE%\Desktop2 thru 4, and then run junction.exe manually to point Desktop to Desktop1.  I thought it might be best for anyone wanting to use this to understand how junction.exe works, rather than just doing it for them.
Why not just have folder called DesktopJunction which could be the Desktop Folder Location and then keep the default Desktop folder.
Also I think that junction part should be automated. An warning could be displayed when starting the app.

For me, having the ini seemed overkill, so I left out those bits.
I agree on this.

Wishing list:
Switch folder for the the quick launch. (will this work?)
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #37 on: November 24, 2007, 08:43:32 AM »

Wishing list:
  • Save and restore desktop icon positions (this should be possible somehow, as I have seen other small apps for this).
  • Switch folder for the the quick launch. (will this work?)

I don't know yet what is possible with autohotkey. Would it be possible to control a Virtual Desktop application with a autohotkey application?
This way we could combine this script with a Virtual Desktop application.
Logged
psionics
Participant
*
Posts: 116


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #38 on: November 24, 2007, 02:53:43 PM »

hey thanks perlguy..  smiley

 tellme im still using fat32 fs for my xp sp2.. but the ahk script didn't work for me(or ... coz of I didn't try the junction.exe from sysinternals yet)..  anyways, the program "ManageDesk" 's  folder switching did work, but not free (meow  Sad ) . can we ask them how they did it?
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #39 on: November 24, 2007, 03:42:37 PM »

hey thanks perlguy..  smiley

 tellme im still using fat32 fs for my xp sp2.. but the ahk script didn't work for me(or ... coz of I didn't try the junction.exe from sysinternals yet)..  anyways, the program "ManageDesk" 's  folder switching did work, but not free (meow  Sad ) . can we ask them how they did it?
As far as I know - junctions only works with NTFS.
There is also something called Shell Links. It's a parallel to the SymLinks of Linux - I think. But not completely the same.
Anyway. I tried to create such a Shell Link with the Winbolic Link program, and I think it will work for this purpose (not the Winbolic app but the Shell Link method).
The only problem, is that I haven't found any command line program which creates Shell Links.
Logged
PhilB66
Supporting Member
**
Posts: 1,510


View Profile Give some DonationCredits to this forum member
« Reply #40 on: November 26, 2007, 12:47:55 AM »

SUperior SU - Desktop Switcher
Logged
psionics
Participant
*
Posts: 116


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #41 on: November 29, 2007, 09:03:53 AM »

SUperior SU - Desktop Switcher

its a windows profile changer  huh
Logged
inshadow
Participant
*
Posts: 8

View Profile Give some DonationCredits to this forum member
« Reply #42 on: November 29, 2007, 10:41:46 AM »

SUperior SU - Desktop Switcher

its a windows profile changer  huh

Yes it is.
But the functionality of the Desktop Folder Switcher script resembles it very much.
Anyway, I tried it out and think it's overkill. I think it takes too many resource for each "desktop" when comparing to our simple solution.
I still want to try to help developing our script, as I need this myself. I don't have much time for this in December though.
Logged
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #43 on: January 03, 2008, 08:05:20 AM »

FOUND ONE!
A beta program, whiche will expire on January 28, 2008.
http://www.extradesktops.com/

I kind of explorer folder layer over desktop.
« Last Edit: January 03, 2008, 08:21:41 AM by apfel » Logged
tomos
Charter Member
***
Posts: 8,695



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #44 on: January 03, 2008, 09:23:44 AM »

FOUND ONE!
A beta program, whiche will expire on January 28, 2008.
http://www.extradesktops.com/

I kind of explorer folder layer over desktop.

it's not very clear what exactly that does -
have you tried it apfel?

wonder is it more like virtual desktops or psionics idea undecided
Logged

Tom
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #45 on: January 03, 2008, 10:01:38 AM »

Yes, I tested on Xp and it works.
You need to set a folder, which you want to display as new desktop and a hotkey.
With the hotkeys you can simply switch the displayed desktop/icons to another folder's files/icons without explorer.exe restart.
« Last Edit: January 03, 2008, 10:03:35 AM by apfel » Logged
psionics
Participant
*
Posts: 116


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #46 on: January 04, 2008, 03:01:16 PM »

nice find! you have to install the visual C++ 2005 first before installing Extra Desktop. its works great just what i wanted! i don't mind if the icons doesn't have shadows (very good thing there is that it is layered to desktop even if you press win+D while dragging a file). (expires on January 28) Sad  it got everything i need but i think its not free..  undecided

and the bug i've discovered in, when you click a folder, the whole desktop goes to that folder instead of opening a window for it. and it cannot be reverted back to it's root desktop profile even if you press the backspace key. i think each desktop must have a "back" icon(if folders opening aren't implemented as floating windows) and a "recycle bin". (theres a desktop scrollbar and view as thumbnails which is cool tongue )  but still not it..
« Last Edit: January 04, 2008, 03:46:40 PM by psionics » Logged
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #47 on: January 04, 2008, 04:50:16 PM »

@psionics You need to unclick the box with "browsing.." in the settings.
Its free, but in development status...

I discoverd a small Hotkey bug, too.
« Last Edit: January 04, 2008, 04:52:03 PM by apfel » Logged
psionics
Participant
*
Posts: 116


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #48 on: January 05, 2008, 07:32:37 AM »

ohh. that is good to hear that it is free.. yeah i know to troubleshoot those thanks btw.. i was hoping for its improvement from the bug. what is great is that it works like in DLL, not an application. but when it hangs.. you have to refresh exporer.exe but not a serious issue i think.
Logged
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #49 on: January 05, 2008, 11:13:39 AM »

I hope a big Bugfixed Version will arrive on January 28, 2008.
Logged
Pages: Prev 1 [2] 3 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.043s | Server load: 0.06 ]