Create batch and powershell that ask for computer name and user profile to copy certain folders between old and new computers over network and show progress bar while  copying and log file

A A
A A used Ask the Experts™
on
Hello Team
I like to have a batch  cmd file or powershell script to  copy folders (documents,downloads,desktop,favorites) from user that has old computer  with old computer name to user  that will have new computer  with another computer name  both computers have different computer names and connected to same network as I would like to run this  script on  new computer of user so  it has to ask for computer name so I write old computer name of user and then ask about user folder so I select user profile from c users folder and after it copies documents ,downloads,desktop ,favorites from old computer of user to new computer of the user as i would like to acheive that in powershell and batch cmd  that shows progress bar while copying and log file
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
mbkitmgrOwener

Commented:
You could use Robocopy but you wouldnt have a progress bar.  It does however show progress on screen.

"c:\Windows\System32\Robocopy.exe" "\\NAS\ShareName" "%~dp0\NAS2_Ask Itee" *.* /E /X /R:1 /W:1 /PURGE /IPG:%IPGNUM% /LOG+:%BackupLogName% /TEE /NP

Open in new window


Robocopy is native on all versions of windows
A A

Author

Commented:
I need script t to ask for  computer name and user profile before  copying and accordingly the copy process start copying downloads, desktop,favorite , documents and progress bar is appearing
mbkitmgrOwener

Commented:
The batch text below gets the destination PC name and assumes the user will log onto the new PC with the same user name

ECHO OFF
REM gets Destination PC Name and collects existing userprofile name
:GETNewPCName
CLS
REM Get computername.
	SET /p NewPCName="Enter PC Name:"
	ECHO You Entered computer Name %NewPCName% is this correct?
	SET /p Response="Y/N >>> "
	If /I %Response%==N GOTO GETNewPCName

REM this assumes the username will be the same
	SET /p UserProfName=%username%
	ECHO Your destination profile is %UserProfName%

Open in new window

Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

A A

Author

Commented:
Could  you please to have one script that include everything  that ask user for computer name and user profile name then copy specific folders as downloads and desktop and favorites and documents  and  show  progress bar while copying and what is actually doing and log file afterwards
A A

Author

Commented:
Hi Experts
could you please help me in having one script that include everything  that ask user for computer name and user profile name then copy specific folders as downloads and desktop and favorites and documents  and  show  progress bar while copying and what is actually doing and log file afterwards
A A

Author

Commented:
I would like to receive solutions for this question from  experts-please
A A

Author

Commented:
Need more info and comments from all experts please

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial