• Code to run a batch file located on a different server

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Code to run a batch file located on a different server

    Author
    Topic
    #486226

    Hi,

    I have the following code I found on the internet that would work great if the batch file I needed to run was located on my local computer. The windows batch file I need to run is located on a server that I have created a map for (E drive). How can I get the following code to work on the mapped drive of E?

    Note:
    When I log onto the F9 server via a VNC viewer connection, the file path is:
    C:F9V5pro50_pIFMUpdate.bat

    Any help is always appreciated!

    Thank you!
    Lana

    Sub Run_Batch_File()

    Dim Update As Double

    ChDir “E:”
    Update = Shell(“cmd /k E:IFMUpdate.bat“, vbNormalFocus)

    End Sub

    Viewing 0 reply threads
    Author
    Replies
    • #1355555

      I don’t do VB, but from an ordinary server point of view I would suggest:

      Update = Shell(“cmd /k E:F9V5pro50_pIFMUpdate.bat“, vbNormalFocus)

      and possibly change the cmd /k to cmd /c .

      Obviously this assumes that you have mapped E: to C$ on the server – if this isn’t the case, the path will change accordingly!

      BATcher

      Plethora means a lot to me.

    Viewing 0 reply threads
    Reply To: Code to run a batch file located on a different server

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: