Jump to content

Recommended Posts

Posted (edited)

Hello there ... I'm lost & I need help.

Please I need help with my batch file ...

My knowledge is really basic ... I need help ...

I'm willing to make a basic batch file which will prompt the user to type the old account name and the new account and copy the files and overwrite the duplicates ...

incase if one of the users of windows is willing to change his account due to some problems with his current account he can make new one and then copy all files to it.

is this possible ???

this is what I have done !

echo This Batch file will help you moving your files from your old account to the new one quickly !

puse

move /y "C:\Documents and Settings\old C:\Documents and Settings\new"

@echo

I have no idea how to make the input for the account names ??????????

Please Help me ?

Thanks

Edited by amlife

Posted

Thanks for your help

This is what I came with !! but it's not working as it suppose to ...

it looks fine for me !!

----------------------------------------------

@echo off

echo This Tool will copy your files quickly from one account to another.

@echo off

echo enter your old account name.

set /p variable1=

echo You have entered : %variable1%

@echo off

echo enter your new account name.

set /p variable2=

echo You have entered : %variable2%

pause

MOVE /y "%homedrive%Documents and Settings\%variable1%" "%homedrive%Documents and Settings\%variable2%"

---------------------------

Anybody can add something to fix it

Thanks

Posted (edited)

As you are using MOVE, you will need to create the new containing folder first?

Also the %HOMEDRIVE% variable, as far as I know, doesn't include the 'backslash'

Using your syntax etc.

IF NOT EXIST "%HOMEDRIVE%\Documents and Settings\%variable2%" (
MD "%HOMEDRIVE%\Documents and Settings\%variable2%" && (
MOVE "%HOMEDRIVE%\Documents and Settings\%variable1%" "%HOMEDRIVE%\Documents and Settings\%variable2%"))

<Edit>

Also I just thoght I'd mention one other thing, have you considered security permissions on the files and folders? or is the %homedrive% not NTFS?

</Edit>

Edited by Yzöwl

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...