Solved Batch file to move desktop icons so ALL are sorted.

Skyzoomer

New member
Member
Local time
8:59 PM
Messages
37
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:

My Computer My Computer

At a glance

Windows 7 Home Premium 64bit
OS
Windows 7 Home Premium 64bit
I'm not quite sure what your goal is here.

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

My Computer My Computer

At a glance

7 Ultimate x64/7 Home Premium x64Intel i3 550 3.2 GHzCorsair 16 GB DDR3 (4 X 4GB)Intel HD Graphics
Computer Manufacturer/Model Number
Dell Inspiron 580
OS
7 Ultimate x64/7 Home Premium x64
CPU
Intel i3 550 3.2 GHz
Motherboard
Dell/Intel H57
Memory
Corsair 16 GB DDR3 (4 X 4GB)
Graphics Card(s)
Intel HD Graphics
Sound Card
Intel P55 HD Audio
Monitor(s) Displays
LG E2360 LED
Screen Resolution
1920 X 1080
Hard Drives
Seagate 1TB X 2 Internal,
Seagate 1TB eSATA (Backup)
PSU
Dell 300W
Case
Dell Inspiron
Cooling
Dell/Intel
Keyboard
Microsoft Wireless Comfort Keyboard 5000
Mouse
Microsoft Wireless Mouse 5000
Internet Speed
4,000 Mbit DSL
Other Info
Custom Installation -
OS separate on C:
Pagefile Separate on P:
Program Files Separate on U:
Users and ProgramData separate on V:
Try this batchfile.

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

My Computer My Computer

At a glance

MS Windows 7 Ultimate 64-bit SP1i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Br...4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)Video Intel(R) HD Graphics Family, 1696MB ava...
Computer Manufacturer/Model Number
Toshiba Satellite P775-S7232
OS
MS Windows 7 Ultimate 64-bit SP1
CPU
i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Bridge 32nm
Motherboard
Toshiba PHRAA ver. PSBY1U-00F003
Memory
4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)
Graphics Card(s)
Video Intel(R) HD Graphics Family, 1696MB available memory
Sound Card
Realtek High Definition Audio version=6.0.1.6323
Monitor(s) Displays
17.3 " Trubrite TFT LCD, LED Backlit
Screen Resolution
1600x900 32 bit, Native support for 720P content
Hard Drives
TOSHIBA MK6476GSXN
580.614 [GB] partitioned C: 80GB and D: 500GB with hidden recovery partitons.

Spare bay for 2nd HDD but no SATA connector :-(
PSU
Toshiba AC/DC Adapter
Case
Notebook
Cooling
Built-in Fan
Keyboard
Premium Raised Tile keyboard
Mouse
Logitech M215 wireless mouse
Internet Speed
Not fast enough
Other Info
Built-in Harman Kardon speakers with Dolby Advanced Audio, Waves MaxxAudio® 3. HDMI, 1xUSB3+3xUSB2 ports, WebCam, Battery life 4hrs 11mins, 4GB Readyboost SDHC card, WD My Book Essential Ext HDDs 2 TB, 2x1TB, My Passport SE 1TB and WDTV 1st Gen for Multimedia playing on a Sony Wega 32" LCD.
Recent addition to my toys are Asus Transformer Pad TF300T with 32GB onboard sd card + 32GB microsd card.
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 My Computer

At a glance

Windows 7 home premium x64AMD FX-4100 AM3+ 3.6GHz 12MB Black EditionCrsair vengeance 12Gb DDR3 1600MHz CL9Asus GTX 560 1GB
Computer Manufacturer/Model Number
DIY
OS
Windows 7 home premium x64
CPU
AMD FX-4100 AM3+ 3.6GHz 12MB Black Edition
Motherboard
Asus M5A97 Pro
Memory
Crsair vengeance 12Gb DDR3 1600MHz CL9
Graphics Card(s)
Asus GTX 560 1GB
Sound Card
Realtek onboard
Monitor(s) Displays
Hanns G 1680x1050 native
Hard Drives
OCZ 128Gb Petrol ssd
2x500 Gb Samsung
PSU
OCZ StealthXstream II 500W
Internet Speed
8Mb or better
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 My Computer

At a glance

Windows 7 Home Premium 64bit
OS
Windows 7 Home Premium 64bit
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 My Computer

At a glance

Windows 7 Home Premium 64bit
OS
Windows 7 Home Premium 64bit
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 My Computer

At a glance

Windows 7 Home Premium 64bit
OS
Windows 7 Home Premium 64bit
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...

cmd scr prt 01.PNG
 

My Computer My Computer

At a glance

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x6...AMD Athlon II x4 6206GB GSkill DDR2 800AMD 4670 GPU + AMD 4200 IGP
Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
AMD 4670 GPU + AMD 4200 IGP
Sound Card
on board Realtek ALC889A
Monitor(s) Displays
RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor
Screen Resolution
1680 x 1050
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.

Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.

Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner.
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.
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...

View 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 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 My Computer

At a glance

Windows 7 Home Premium 64bit
OS
Windows 7 Home Premium 64bit
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 My Computer

At a glance

MS Windows 7 Ultimate 64-bit SP1i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Br...4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)Video Intel(R) HD Graphics Family, 1696MB ava...
Computer Manufacturer/Model Number
Toshiba Satellite P775-S7232
OS
MS Windows 7 Ultimate 64-bit SP1
CPU
i5-2410M 2.3GHz (2.9GHz Turbo-Boost) Sandy Bridge 32nm
Motherboard
Toshiba PHRAA ver. PSBY1U-00F003
Memory
4GB+4GB Samsung DDR3 PC3-10700 (1333 MHz)
Graphics Card(s)
Video Intel(R) HD Graphics Family, 1696MB available memory
Sound Card
Realtek High Definition Audio version=6.0.1.6323
Monitor(s) Displays
17.3 " Trubrite TFT LCD, LED Backlit
Screen Resolution
1600x900 32 bit, Native support for 720P content
Hard Drives
TOSHIBA MK6476GSXN
580.614 [GB] partitioned C: 80GB and D: 500GB with hidden recovery partitons.

Spare bay for 2nd HDD but no SATA connector :-(
PSU
Toshiba AC/DC Adapter
Case
Notebook
Cooling
Built-in Fan
Keyboard
Premium Raised Tile keyboard
Mouse
Logitech M215 wireless mouse
Internet Speed
Not fast enough
Other Info
Built-in Harman Kardon speakers with Dolby Advanced Audio, Waves MaxxAudio® 3. HDMI, 1xUSB3+3xUSB2 ports, WebCam, Battery life 4hrs 11mins, 4GB Readyboost SDHC card, WD My Book Essential Ext HDDs 2 TB, 2x1TB, My Passport SE 1TB and WDTV 1st Gen for Multimedia playing on a Sony Wega 32" LCD.
Recent addition to my toys are Asus Transformer Pad TF300T with 32GB onboard sd card + 32GB microsd card.
Skyzoomer,

You're welcome and glad you got this sorted out.
Please mark this thread as Solved.

Thanks,
David
 

My Computer My Computer

At a glance

Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x6...AMD Athlon II x4 6206GB GSkill DDR2 800AMD 4670 GPU + AMD 4200 IGP
Computer type
PC/Desktop
Computer Manufacturer/Model Number
home built
OS
Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
CPU
AMD Athlon II x4 620
Motherboard
Gigabyte GA-MA785G-UD3H
Memory
6GB GSkill DDR2 800
Graphics Card(s)
AMD 4670 GPU + AMD 4200 IGP
Sound Card
on board Realtek ALC889A
Monitor(s) Displays
RCA 40" LCD TV, Insignia 32" LCD TV, HP 15" LCD monitor
Screen Resolution
1680 x 1050
Hard Drives
OCZ Vertex 3 120GB,
Samsung F3 1TB (3),
Several others - WD, Seagate, Hitachi, ...
PSU
Corsair 500 W
Case
Rosewill mid tower
Cooling
CM 90mm rifle
Keyboard
Gyration wireless, Logitech wireless, Dell USB wired
Mouse
Gyration wireless, Logitech wireless, V7 USB wired
Internet Speed
Spectrum - 100Mbps D / 10Mbps U
Antivirus
Avast, MBAM3, EMET, WinPatrol
Browser
Pale Moon, Firefox, IE
Other Info
2 multi-boot PC's
Mainly HTPC/Office/Gen purpose (no gaming).
Trendnet USB KVM.
LG DVD burner/Blue Ray Player.
Tray system for removable SATA backup drives.

Not currently OCd, under-volted.
I use Hybrid sleep, rarely re-boot or shutdown.

Hauppauge HD-PVR, Avermedia PCIe TV Tuner, Hauppauge PCI TV Tuner.
Difference between Public Desktop and Desktop

I know this post is over 5 years old but it still has value so... To answer a lot of your questions about why some systems use Public Desktop and others use Desktop is because Microsoft has no common sense. There may be an actual logical reason for this but there is no way to actually search for the answer since Google and Bing are flooded with people posting junk. It's similar to my first job out of High School at a Nuclear Power plant. The Inventory was about 100,000 pages because people were calling things by different names. Some called a light bulb a lamp, others a bulb, others a light bulb.

I asked Microsoft this question, we'll see if they actually have a logical answer or just a Microsoft answer.
 

My Computer My Computer

At a glance

Windows 7 Pro and Enterprise x86 and x64Multiple 1.2 to 3.0Multiple 2gb to 8gbMultiple
Computer Manufacturer/Model Number
Multiple Dell and HP
OS
Windows 7 Pro and Enterprise x86 and x64
CPU
Multiple 1.2 to 3.0
Motherboard
Multiple
Memory
Multiple 2gb to 8gb
Graphics Card(s)
Multiple
Sound Card
Multiple
Monitor(s) Displays
Multiple
Hard Drives
Multiple 80gb to 1 tb
PSU
Multiple
Case
Tower
Cooling
Multiple fans
Back
Top