Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch file to move desktop icons so ALL are sorted.

19 Mar 2012   #1

Windows 7 Home Premium 64bit
 
 
Batch file to move desktop icons so ALL are sorted.

Windows 7 stores desktop icons in two different folders:
C:\Users\Public\Public Desktop
C:\Users\UserName\Desktop

This results in two groups of sorted icons on the desktop. I want to move all of the icons in the "C:\Users\Public\Public Desktop" to the "C:\Users\UserName\Desktop". This will result in ALL of the desktop icons being sorted.

I want to use a batch file to do the move. Then click on a desktop icon to run the batchfile. How can I do this?

----------

The batch file I've come up with is named "movicons.bat" as follows:
rem @echo off
move "C:\Users\Public\Public Desktop\*.*" C:\Users\Dad\Desktop

I created a desktop shortcut named "MovIcons" with the target as:
D:\Batfiles\movicons.bat

But when I click that desktop icon, the icons are not moved. Need help to get it all working.

Thanks,
Skyzoomer

My System SpecsSystem Spec
.

19 Mar 2012   #2

7 Ultimate x64/7 Home Premium x64
 
 

I'm not quite sure what your goal is here.

Do you have duplicate icons on C:\Users\Dad\Desktop?
My System SpecsSystem Spec
19 Mar 2012   #3

MS Windows 7 Ultimate 64-bit SP1
 
 

Try this batchfile.

rem @echo off
move C:\Users\Public\Desktop\*.* C:\Users\Dad\Desktop
My System SpecsSystem Spec
.


19 Mar 2012   #4

Windows 7 home premium x64
 
 

They are deliberately different, one is a public accessible area with links to progrmans that anyone may use. Dad's are specifically for your profile, which if Admin also gives permissions over a normal account.
What puzzles me is why you cannot just open one and select all, then copy or move to the other.
My System SpecsSystem Spec
19 Mar 2012   #5

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by bbearren View Post
I'm not quite sure what your goal is here.
Do you have duplicate icons on C:\Users\Dad\Desktop?
No duplicate icons.

When installing programs, if the installation process creates the desktop link the link usually ends up in the "Public desktop" folder:
..... Apple Orange Zucchini

When I create desktop links to programs myself, they end up in Dad's desktop folder.
..... Carrot Grape Tomato

Example of how the icons appear on Windows 7's desktop:
..... Apple Orange Zucchini Carrot Grape Tomato

How I want them to appear on the desktop:
..... Apple Carrot Grape Orange Tomato Zucchini
My System SpecsSystem Spec
19 Mar 2012   #6

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by rraod View Post
Try this batchfile.

rem @echo off
move C:\Users\Public\Desktop\*.* C:\Users\Dad\Desktop
That path won't work.

Windows 7's public desktop icons are stored in this path:
C:\Users\Public\Public Desktop.
My System SpecsSystem Spec
19 Mar 2012   #7

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by cyclic View Post
They are deliberately different, one is a public accessible area with links to progrmans that anyone may use. Dad's are specifically for your profile, which if Admin also gives permissions over a normal account.
What puzzles me is why you cannot just open one and select all, then copy or move to the other.
Yes, I can manually copy the icons using Windows 7's drag and drop as you pointed out. But that takes multiple steps. I want to just create a batch file and desktop shortcut that will do it all with a single click. Then I will be able to sort all of my desktop icons for the next 8 years of using Win 7 with single clicks.

I did this when I was running Windows XP and it worked fine (though the paths were different). I just can't get it to work running Win 7.

My theory is what I learned when taking a programming class many years ago:
"Don't make the human do what the computer can do better and faster."
My System SpecsSystem Spec
19 Mar 2012   #8

Win 7 Pro x64 SP1, Win 7 Ult x86 SP1
 
 

Quote:
That path won't work.

Windows 7's public desktop icons are stored in this path:
C:\Users\Public\Public Desktop.
Did you try using "C:\Users\Public\Desktop" for the path?

In my screen print you can see "C:\Users\Public\Public Desktop" gets an error.
cd = change directory.

You can also add a "pause" command at the end of your BAT file to keep the bat CMD window open.
This can be helpful for troubleshooting so you can see any messages.

If there are permission errors, you may need to run the bat file with "Run as administrator".

Each of those folders should have a hidden "desktop.ini" file.
I'm not sure if that will cause a problem, but you may have to deal with that...

Batch file to move desktop icons so ALL are sorted.-cmd-scr-prt-01.png


My System SpecsSystem Spec
19 Mar 2012   #9

Windows 7 Home Premium 64bit
 
 

Quote   Quote: Originally Posted by rraod View Post
Try this batchfile.

rem @echo off
move C:\Users\Public\Desktop\*.* C:\Users\Dad\Desktop
Quote   Quote: Originally Posted by DavidW7ncus View Post
Quote:
That path won't work.

Windows 7's public desktop icons are stored in this path:
C:\Users\Public\Public Desktop.
Did you try using "C:\Users\Public\Desktop" for the path?

In my screen print you can see "C:\Users\Public\Public Desktop" gets an error.
cd = change directory.

You can also add a "pause" command at the end of your BAT file to keep the bat CMD window open.
This can be helpful for troubleshooting so you can see any messages.

If there are permission errors, you may need to run the bat file with "Run as administrator".

Each of those folders should have a hidden "desktop.ini" file.
I'm not sure if that will cause a problem, but you may have to deal with that...

Attachment 203515
rraod and DavidW7ncus,

To each of you, "You are the man!" (or woman)

Your suggestion to use the "C:\Users\Public\Desktop\*.*" for the path worked!

I would love to know why it works. When I use Windows 7's explorer, the public icons are stored in "C:\Users\Public\Public Desktop". There is no "Desktop" folder in the C:\Users\Public path.

Thanks!
Skyzoomer
My System SpecsSystem Spec
19 Mar 2012   #10

MS Windows 7 Ultimate 64-bit SP1
 
 

The "Public Desktop" in "C:\Users\Public\Public Desktop" is not really a folder but an alias to the "Desktop" folder in C:\Users\Public which is "C:\Users\Public\Desktop.

In Batch programming the "Public Desktop" does not work but \Public\Desktop works.

I have given the above example only after checking that it works. Have you tried it? Try it once.
My System SpecsSystem Spec
Reply

 Batch file to move desktop icons so ALL are sorted.




Thread Tools



Similar help and support threads for2: Batch file to move desktop icons so ALL are sorted.
Thread Forum
Change a lot of icons with a Batch file? Customization
desktop icons doesn't move General Discussion
Solved Batch File to Move a list of files. General Discussion
Desktop icons copy when I move them General Discussion
Desktop icons move next to folders? General Discussion
Batch file to move (many) duplicted folder contents - Help!! General Discussion
How to create a batch file that will move files based on the file type General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 05:13 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33