Results 1 to 8 of 8

Thread: [RESOLVED] batch of copy in icon on desktop....

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,941

    Resolved [RESOLVED] batch of copy in icon on desktop....

    I have file .doc and .xls in \\myserverdir\mydir\..... and in c:\\mydir\
    in this two dir are the same number of file with the same name. in effect i the same dir.
    Now i want to create a desktop icon with a a batch DOS or other language to:
    copy from dir of server all files and paste this files in c:\mydir... but no show the message "file existis do yoy want to overwrite yes/no..."
    Always in this batch or program controll if one of file in c:\mydir is in use from the user and during the copy show message "attention i cannot complete the operation of copy becaus you have a file in use, close it and repeat the operation"

    Tath is all.

    Tks.

  2. #2
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: batch of copy in icon on desktop....

    Use Copy /? for more information...

  3. #3
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: batch of copy in icon on desktop....

    use xcopy, not copy.
    Xcopy contains a switch to continue copy operations even if an error occurs in the current batch operation. ( /c) You will need to use it if you have a problem with locked files.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,941

    Re: batch of copy in icon on desktop....

    tks randem and lord oewell...
    I have understand but not uderstant hoe to integrate this commend of copy in a icon;-) sorry.

  5. #5
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: batch of copy in icon on desktop....

    If you want an actual icon, you will need to make a shortcut to the batch file you create. An example is this:
    XCOPY "Sourcepath" "Destinationpath" /c /s
    where /c = force copy (except the locked file won't be updated)
    /s copies subdirectories
    put the line similar to this in a text file and give it the .bat extension
    put that file on your desktop and it is clickable. However you can't give it a custom icon. You would have to use a shortcut and give that the custom icon.
    Also, this isn't exactly the best way to do something like this. Your best option is create a program to do it for you in visual basic. There are plenty of samples available in the forum for copying directories.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,941

    Re: [RESOLVED] batch of copy in icon on desktop....

    Hi Lord Orwell with you have solved all!! tks.
    But only one...
    Is possible to controll before the copy if the dest dir in c:\ existsis and if not create it before the command of copy in batch line.
    Tks.

  7. #7
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: [RESOLVED] batch of copy in icon on desktop....

    Add the /I switch. It makes xcopy understand you are reading a directory, as long as there are at least two files in it. Your other option is adding an if statement in the .bat file. The syntax would be similar to this:
    if not exist ".\mydirectory" MD ".\mydirectory"
    the above statement in plain english equals this:
    If ".\mydirectory" doesn't exist then create (MD stands for make directory) it.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Mar 2005
    Posts
    2,941

    Re: [RESOLVED] batch of copy in icon on desktop....

    Quote Originally Posted by Lord Orwell
    Add the /I switch. It makes xcopy understand you are reading a directory, as long as there are at least two files in it. Your other option is adding an if statement in the .bat file. The syntax would be similar to this:

    the above statement in plain english equals this:
    If ".\mydirectory" doesn't exist then create (MD stands for make directory) it.
    Hi Lord Orwell...
    Tks for all! and tks for patience.
    Now all work fine.
    Sorry for my english is alf Italian and Napolitan;:-)
    I live in Italy (in Napoli)
    Virtual Pizza for you.
    Sal.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width