Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jul 2002
    Location
    Ankeny, Iowa, USA
    Posts
    344
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Code to run a batch file located on a different server

    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:\F9V5\pro50_p\IFMUpdate.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

  2. #2
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,496
    Thanks
    34
    Thanked 203 Times in 182 Posts
    I don't do VB, but from an ordinary server point of view I would suggest:

    Update = Shell("cmd /k E:\F9V5\pro50_p\IFMUpdate.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

    "The trouble with quotes on the internet is that you can never know if they are genuine."
    Abraham Lincoln
    

  3. The Following User Says Thank You to BATcher For This Useful Post:

    LJM (2012-11-08)

Posting Permissions

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