This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Technology & Calculator Open Topic subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. Computer Tech Support => Technology & Calculator Open Topic
Author Message
chesshaha


Newbie


Joined: 07 Apr 2006
Posts: 33

Posted: 02 Feb 2007 01:46:43 am    Post subject:

I am writing a batch file call copycat.bat because to make copying from my flash drive to my hard drive easier.

xcopy F:\. C:\newplace /e
cls
copycat
IF Overwrite GOTO END
:end

If there's overwrite I want the file to end, what do I need to replace overwrite with to make it work?


Last edited by Guest on 02 Feb 2007 01:48:46 am; edited 1 time in total
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 02 Feb 2007 03:21:28 am    Post subject:

What's wrong with drag and drop?

Just do this:

xcopy f:\ c:\newplace /e /k /x /y

/k and /x are to preserve file attributes. /y suppresses the overwrite confirmation question, but doesn't override read-only because you don't use /r. If it comes to a read-only file it simply ends the copying process saying "access denied".

Why you want to automate not overwriting read-only files is beyond me, though. Just drag and drop and hit escape when the overwrite confirmation dialog pops up.

I say, just overwrite it, because otherwise you simply end up with a half-updated local folder.


Last edited by Guest on 02 Feb 2007 03:24:07 am; edited 1 time in total
Back to top
chesshaha


Newbie


Joined: 07 Apr 2006
Posts: 33

Posted: 03 Feb 2007 02:13:21 am    Post subject:

No, you are missing the point.

I want:

If overwrite confirmation question come up, It will go to end.

I don't want to overwrite over and over again.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 03 Feb 2007 05:36:07 am    Post subject:

xcopy /y without /r does end without overwriting.
Back to top
chesshaha


Newbie


Joined: 07 Apr 2006
Posts: 33

Posted: 04 Feb 2007 01:35:56 am    Post subject:

No, cmd won't close, it will just keep running copycat.bat
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 04 Feb 2007 04:19:20 am    Post subject:

Don't run anything but "xcopy f:\ c:\newplace /e /k /x /y". No cls. No recursive restarting of copycat.bat. No goto end. Nothing but that line.
Back to top
chesshaha


Newbie


Joined: 07 Apr 2006
Posts: 33

Posted: 06 Feb 2007 12:26:01 am    Post subject:

Yea, I understand what are you trying to say.

BUT, I want cmd closes itself!

Thanks
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 06 Feb 2007 03:02:55 am    Post subject:

cmd closes itself automatically if the program it was called up to run ends.

Don't start cmd yourself and then run xcopy manually, but make a shortcut to xcopy with the right parameters. Then, when you run it, a command prompt window will come up to show output from the program, and then close when the program ends.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement