I have a memory stick that I want to sync up with my school folder(We use a Novell server so everyone has school storage) and here is what I came up with. I was wondering how I could prompt the user(me) on which file to keep as now it keeps the most recent version(the d paramater on xCopy)

Here is the script(Batch file)


Code:
@echo off ;disable output
cd \ ;get to root level
xcopy /edy h:\*.* ;copy files newer than destination from school to memory stick
xcopy /edy *.* h:\ ;copy files newer than destination from memory stick to school.
h: ;go to school drive
del H:\sync.bat
del H:\autorun.inf ;delete autorun files
echo Done. You may now exit.
exit


Autorun is just a simple autorun

Code:
[autorun]
open=sync.bat


It works good, but I would like the ability to choose which one I keep. Any ideas?

edit:Get rid of the comments. I havn't done Batch in a while and forgot I had to use the ; on a new line or use REM on a new line. Neutral
Doesn't that defeat the purpose of an auto-sync tool if it requires manual input?

However, you want the /-Y option - which you would have found out if you DID A SIMPLE GOOGLE SEARCH!!!!!
You'd have to still remember to run the batch script, wouldn't you? Smile
KermMartian wrote:
You'd have to still remember to run the batch script, wouldn't you? Smile


I believe he is putting it in the AUTORUN.INF file on the memory stick, which windows (rather stupidly) automatically runs for any removeable media (cdrom, floppy, usb drive, etc...)
Doesn't work for removable media; I've tried.
Wasn't the windows briefcase feature created for this exact purpose? Why are you writing batch files when you could just use those?
KermMartian wrote:
Doesn't work for removable media; I've tried.


Do you have autorun enabled for removeable media?
Kllrnohj wrote:
KermMartian wrote:
Doesn't work for removable media; I've tried.


Do you have autorun enabled for removeable media?
No, and most of the computers that I'd want to autorun removeable media on have such options disabled.
Autoron is enabled by default, but it is a good idea to disable it on removeable media Smile
Kllrnohj wrote:
Autoron is enabled by default, but it is a good idea to disable it on removeable media Smile
Which Windows OS is that valid on? I believe it's not on XP, and I'm almost positive it isn't on 2000./
not all USB drives support auto-run if remember correctly (for some weird reason).
I'm fairly certain its enabled by default for all windows, but most def for XP
rivereye wrote:
not all USB drives support auto-run if remember correctly (for some weird reason).
Perhaps that's what the issue is then.
Ok, two things, didn't they get rid of the briefcase in 98???

and I am using an autorun.

Also, I am using this on multiple computers. I want to make it execute minimized, but they have the properties menu disabled at school! fucking security.
netham45 wrote:
Ok, two things, didn't they get rid of the briefcase in 98???

and I am using an autorun.

Also, I am using this on multiple computers. I want to make it execute minimized, but they have the properties menu disabled at school! <font color=red>censored</font> security.
You can still use the Briefcase in XP iirc; it's just disabled by default.
netham45 wrote:
Ok, two things, didn't they get rid of the briefcase in 98???


Briefcase first showed up in 98, how could they get rid of something that didn't exist? Rolling Eyes

You can't force something to run minimized in BATCH (its a piece of cake with a language that can use the Win32 API Very Happy ), but, um..., why would you want to execute something that requires input minimized? Thats an oxymoron in application design. How do you know if its asking you to pick which one to keep, or if its copying still if it starts minimized??? Seems to me you don't know what you really want....
I got rid of the input, now it just keeps the newer file. Also, I am thinking of porting it to VB...
vb might be a good idea if you can, but it might be hard to do.
netham45 wrote:
I got rid of the input, now it just keeps the newer file. Also, I am thinking of porting it to VB...


Er... why? Seems overkill, as xcopy does all you need done. If you want to try and learn a new language to do it in, learn a *real* language like C or C++ and do it in that
I know VB.... I DID just use xCopy...
  
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
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement