Jump to content

Recommended Posts

Posted

@ tguy - We're not creating anything, just moving stuff from individual user profile directories to the 'All Users' profile directory. This is because all the installed programs etc. will put shortcuts in various places.

As an additional note, with regards the moving of profile subdirectories, if you later create a new user, first logon will put stuff in their profile directory too. This would probably mean that you may wish to consider emptying contents of 'Default User' too! This is of course a hidden directory, and alterations in the code would need to be made in order to include it.

  • 3 years later...

Posted

I got it to work like this:

@echo off
cd "%UserProfile%\.."
for /d %%a in ("%UserProfile%\..\*") do if "%%~na" neq "All Users" call :doit "%%~a"
goto :eof
:doit
pushd %1
robocopy "Start Menu\." "%AllUsersProfile%\Start Menu" /E /Z /MOVE /R:5 /W:2 /XF ?esktop.ini>nul
popd
goto :eof

How do you do the "Default User" folder too?

What does "%%~na" and "%%~a" do?

Posted

ok this moves all the shortcuts:

@echo off
cd "%UserProfile%\.."
for /d %%a in ("%UserProfile%\..\*") do if "%%~na" neq "All Users" call :doit "%%~a"
goto :dup
:doit
pushd %1
robocopy "Start Menu\." "%AllUsersProfile%\Start Menu" /E /Z /MOVE /R:5 /W:2 /XF ?esktop.ini>nul
popd
goto :eof
:dup
robocopy "%userprofile%\..\default user\Start Menu\." "%AllUsersProfile%\Start Menu" /E /Z /MOVE /R:5 /W:2 /XF ?esktop.ini>nul

But I am still wondering what "%%~na" and "%%~a" mean. I can't get any search engines to find % or ~ symbols. :huh:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...