Script to copy a file to a particular folder

Discussion in 'AutoCAD' started by Reid M. Addis, Feb 6, 2004.

  1. This is not specifically an AutoCAD question (though it could be) so here
    goes:
    1. I have a file on the network that gets updated regularly - say...the
    AutoCAD acad.pgp file
    2. I want to deploy this to all the users in the office, who have
    stand-alone versions of AutoCAD installed.
    3. OS varies from XP Pro, to Windows2000 Pro, to Windows 98.
    4. People have different software installed, so using a ~ symbol to identify
    a folder won't work. On one machine that folder might be ~1, while on
    another it might be ~2.

    I've been trying to do this with a simple Batch routine in a login script,
    to no avail. Does anyone know of a *free* way to do this in Windows? If not,
    is there a moderately priced piece of software you could/would recommend?

    Thanks!

    --
    Regards,
    ---------------
    Reid M. Addis
    Registered Architect
    Architectural Applications Specialist
    Granary Associates
    411 North 20th Street
    Philadelphia, PA 19130
    Ph. 215-665-7056
    email:
     
    Reid M. Addis, Feb 6, 2004
    #1
  2. Reid M. Addis

    bturner Guest

    Reid,

    What about adding something like this to your startup file for AutoCAD/ADT:

    (vl-load-com)
    (vl-file-copy "f:/NetworkFilePathGoesHere/Acad.pgp"
    "c:/LocalFilePathGoesHere/Acad.pgp"
    (vl-file-delete "c:/LocalFilePathGoesHere/Acad.pgp")
    )

    This should do what you are asking provided you are in a networked
    environment. This deletes the local file first then copies the updated one
    from your network location to the local folder.

    As a suggestion if I may, if you want everyone to use the same acad.pgp file
    then perhaps placing this in a network location and removing the local file
    would be a better solution. This way when/if you update the content it
    updates for everyone, of course your situation may be unique and not able to
    utilize this method.

    If you are looking for a way to do this in a standard windows startup
    routine and not with AutoCAD/ADT a relatively easy way would be to either
    old MS-Dos or VBScript.

    hope this help,
    beau
     
    bturner, Feb 6, 2004
    #2
  3. Reid M. Addis

    bturner Guest

    Reid,

    I forgot to mention that if all the machines have different OS's, folder
    locations, etc... but all have AutoCAD then lisp/Vlisp may be the way to go
    as that would be the common element between them. With lisp you could then
    set the script to run based on username, machinename, etc.. and push to
    different folders based on this information.

    just a thought.

    -beau
     
    bturner, Feb 6, 2004
    #3
  4. Using VBS. Customize the path of the source file and rename the attached
    file to have a vbs extension.
    Not sure it works for Win98 though.

    --
    Best Regards, Jimmy Bergmark
    CAD and Database Developer Manager at www.pharmadule-emtunga.com
    Take a look at
    JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport
    SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm
    or download some freeware at www.jtbworld.com
    More on AutoCAD 2004;
    www.jtbworld.com/autocad2004.htm
    www.jtbworld.com/autocad2004tips.htm
     
    Jimmy Bergmark, Feb 7, 2004
    #4
  5. Reid M. Addis

    patrick_aps Guest

    Clean and dirty:
    In my computer, environmental settings, system settings, make a new variable ACADDIR="c:\progra~1\AutoCA~2"
    and yes indeed, because you are not standarized in OS or installation folder, you should do this manually on each CAD station.
    In your login script you then can use
    SET COPYCMD=/Y
    SET SOURCEDIR=\\server\share\path
    IF EXISTS ACADDIR COPY %SOURCEDIR%\acad.pgp %ACADDIR%\acad.pgp

    Works fine over here in installation scrips...
     
    patrick_aps, Feb 9, 2004
    #5
  6. Actually, it appears that Beau Turner's privately emailed response is the
    simplest solution:

    xcopy J:\CAD\Downloads\Kip\"PowerPrint 5.2.2"\WinReq.ini C:\"Program
    Files"\"Windows Request"\WinReq.ini /d /c /y

    The quote marks around the paths with spaces avoids the problems of using ~#
    to find folders. The only occasional problem is that sometimes a prompt
    appears to the effect: File or Folder. Not sure why.

    Thanks everyone!
    --
    Regards,
    ---------------
    Reid M. Addis
    Registered Architect
    Architectural Applications Specialist
    Granary Associates
    411 North 20th Street
    Philadelphia, PA 19130
    Ph. 215-665-7056
    email:
     
    Reid M. Addis, Feb 10, 2004
    #6
  7. Reid M. Addis

    patrick_aps Guest

    we had that issue also. There seems to be a difference in the xcopy command in WinNT and Win2000 and WinXP.
    When our script runs great in NT, in 2000 it asks for File/Directory and when overwritiung it asks all?
    thats why i started using the OPYCMD variable to avoid some of these problems.
     
    patrick_aps, Feb 11, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.