MSFN Forum: Need help with batch file - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Need help with batch file Rate Topic: -----

#1 User is offline   amlife 

  • Group: Members
  • Posts: 3
  • Joined: 27-October 06

Posted 27 October 2006 - 11:41 PM

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

This post has been edited by amlife: 27 October 2006 - 11:45 PM



#2 User is offline   Sonic 

  • Sonic
  • Group: Patrons
  • Posts: 1,600
  • Joined: 04-December 03

Posted 28 October 2006 - 04:47 AM

To prompt question :
@echo off
echo Name ?
set /p variable1=
echo You have entered : %variable1%
pause


#3 User is offline   amlife 

  • Group: Members
  • Posts: 3
  • Joined: 27-October 06

Posted 28 October 2006 - 04:35 PM

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

#4 User is offline   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,195
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 28 October 2006 - 05:57 PM

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>

This post has been edited by Yzöwl: 28 October 2006 - 06:04 PM


#5 User is offline   amlife 

  • Group: Members
  • Posts: 3
  • Joined: 27-October 06

Posted 28 October 2006 - 09:08 PM

Thanks for your Help ... which one you think is better to chose xcopy or to keep it as move command ?

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy