ExecCmd ("cmd.exe /c Copy ...)

Posted on 2004-11-29
Last Modified: 2012-06-27
Need help with "ExecCmd()".  What is its purpose and can anyone decipher what might be happening in this line?  I guess the question marks are legal syntax since I am not getting any errors from the shell.  I am trying to figure out someone elses code.

ExecCmd ("cmd.exe /c Copy " & l_Path & "Tensil.txt + " & l_Path & rsPos!SapRoll & "???M.rep + " & l_Path & rsPos!SapRoll & "???T.rep " & l_Path & "Tensil.txt")

Question by:ltrain2015
    1 Comment
    LVL 10

    Accepted Solution

    I guess
    l_Path is a variable the holds a directory path (eg "C:\Mydata\")

    rsPos is a recordset of some sort
    SapRoll is a field in rsPos that holds some further path/file info (eg "MyFile")
     the ??? are  Wild card characters  

    so the code is copying files

    and any  files that begin with value of rsPos!SapRoll with 3 characters followed by either T.rep or M.rep
    from I_Path
    to a single file - Tensil.txt - in the same directory


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    In the article entitled Working with Objects – Part 1 (, you learned the basics of working with objects, properties, methods, and events. In Work…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now