Running a Windows command in VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djavis
    New Member
    • Oct 2007
    • 4

    Running a Windows command in VB

    Hello,

    I was wondering if it's possible to run a regular window's command directly from a VB code like:

    cd My Document
    md New


    Also i want to know if i can use a field's value from an Access form in the command like:
    md "CaseID" (where CaseID is the value of the field).

    Thanks !
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by djavis
    I was wondering if it's possible to run a regular Windows command directly from a VB code ...
    Sure it is. What version of VB?

    Comment

    • GayathriP
      New Member
      • Oct 2007
      • 17

      #3
      You can use the following Windows APIs to run the external commands in VB6.

      1. WaitForSingleOb ject
      2. CreateProcessA
      3. GetExitCodeProc ess
      4. CloseHandle

      If you are not able to make it, i can provide you the code

      Comment

      • djavis
        New Member
        • Oct 2007
        • 4

        #4
        Wow thanks !

        I'm pretty new with the VB stuff so it will be great to have your code.

        I want to have a code that will create for me a folder under a known path (let's call it ROOT). the folder's name should be like a certain field value in my form (let's call it CaseID_Value).
        So it should be something like:

        CD ....\ROOT
        MD Forms![Create][CaseID_Value] where "Create" is the name of the form which i want to take the "CaseID_Val ue" from.

        I really appreciate your help !!!

        Thanks !

        Comment

        Working...