Batch file to move desktop icons so ALL are sorted.

Page 1 of 2 12 LastLast

  1. Posts : 37
    Windows 7 Home Premium 64bit
       #1

    Batch file to move desktop icons so ALL are sorted.


    Win7 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
    Last edited by Skyzoomer; 19 Mar 2012 at 14:38. Reason: changed D:\Batchfiles\movicons.bat to D:\Batfiles\movicons.bat
      My Computer


  2. Posts : 120
    7 Ultimate x64/7 Home Premium x64
       #2

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

    Do you have duplicate icons on C:\Users\Dad\Desktop?
      My Computer


  3. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #3

    Try this batchfile.

    rem @echo off
    move C:\Users\Public\Desktop\*.* C:\Users\Dad\Desktop
      My Computer


  4. Posts : 644
    Windows 7 home premium x64
       #4

    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 Computer


  5. Posts : 37
    Windows 7 Home Premium 64bit
    Thread Starter
       #5

    bbearren said:
    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 Win7's desktop:
    ..... Apple Orange Zucchini Carrot Grape Tomato

    How I want them to appear on the desktop:
    ..... Apple Carrot Grape Orange Tomato Zucchini
      My Computer


  6. Posts : 37
    Windows 7 Home Premium 64bit
    Thread Starter
       #6

    rraod said:
    Try this batchfile.

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

    Win7's public desktop icons are stored in this path:
    C:\Users\Public\Public Desktop.
      My Computer


  7. Posts : 37
    Windows 7 Home Premium 64bit
    Thread Starter
       #7

    cyclic said:
    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 win7'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 Computer


  8. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #8

    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 Computer


  9. Posts : 37
    Windows 7 Home Premium 64bit
    Thread Starter
       #9

    rraod said:
    Try this batchfile.

    rem @echo off
    move C:\Users\Public\Desktop\*.* C:\Users\Dad\Desktop
    DavidW7ncus said:
    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
    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 Win7'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 Computer


  10. Posts : 742
    MS Windows 7 Ultimate 64-bit SP1
       #10

    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 Computer


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 09:54.
Find Us