amlife Posted October 28, 2006 Posted October 28, 2006 (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 October 28, 2006 by amlife
Sonic Posted October 28, 2006 Posted October 28, 2006 To prompt question :@echo offecho Name ?set /p variable1=echo You have entered : %variable1%pause
amlife Posted October 28, 2006 Author Posted October 28, 2006 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 offecho This Tool will copy your files quickly from one account to another.@echo offecho enter your old account name.set /p variable1=echo You have entered : %variable1%@echo offecho enter your new account name.set /p variable2=echo You have entered : %variable2%pauseMOVE /y "%homedrive%Documents and Settings\%variable1%" "%homedrive%Documents and Settings\%variable2%"---------------------------Anybody can add something to fix it Thanks
Yzöwl Posted October 28, 2006 Posted October 28, 2006 (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 October 29, 2006 by Yzöwl
amlife Posted October 29, 2006 Author Posted October 29, 2006 Thanks for your Help ... which one you think is better to chose xcopy or to keep it as move command ?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now