Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to move all files from a folder for a user to a centralized folder on a core server

$
0
0

Hello,

I'm curious if there is a batch file that can be made to move the contents that are setup like this....

I'm having to redo a TS cluster and I'd like to make a batch file script that can be executed that moves the contents of say 'jsmith's local desktop profile @ \\NGTTS1\users\jsmith to a centralized folder on our roaming desktop profile server that saves all of the files for the desktops @ \\NGTFS1\users\jsmith.

The problem I have is no matter what I tell users to save there files to our Y drive that is a folder that is synced across all 6 of our TS servers, users still store files on there desktops, so as you can imagine if one day they are on one server, then next day they could be on another and there files aren't the same.... hence the reason why I want to move all there files to the centralized server so when I redo the profiles from scratch on the TS server in the farm they suck files from the core server and have all of the files they are used to having.... 

Now I know I can do this with a MOVE command I've just never done one to this exact.

Hopefully someone knows the command to move all the contents of one folder on one server to the folder on a different server. I've already got the bulk of the coding done of the .bat script I just don't know this move command:

would it be this:

move \\NGTTS1\users\jsmith *.* \\NGTFS1\users\jsmith

any help would be appreciated, I'm sure this is a easy command to do!

This is the coding I have so far....

@echo off
color 0A
title Moving Local Profile folder to Centralized Profile Folder on Core Server.
 
:start
echo Welcome, %USERNAME%
echo What would you like to do?
echo.
echo 1. Moving Local Profile folder to Centralized Profile Folder on Core Server
echo. 
echo 0. Quit
echo.
 
set /p choice="Enter your choice: "
if "%choice%"=="1" goto Move-user-profiles
echo.
if "%choice%"=="0" exit
echo Invalid choice: %choice%
echo.
pause
cls
goto start
 
 
:Move-user-profiles
echo.
set /p profile="Enter user profile: "
move "\\NGTTS1\users\%profile%" *.* "\\NGTFS1\users\%profile%"
echo moving files from local profile folder to FS1 profile server, stand-by...
echo.
goto cancel-special 
 
:cancel-special
set /p cancel="Type cancel to stop action: "
if not "%cancel%"=="cancel" exit
cls
echo Action is cancelled.
echo.
 
pause
exit


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>