Results 1 to 2 of 2
  1. #1
    merebag is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2016
    Posts
    19

    Running a DOS/CMD command with parameters executed from VBA

    I have a routine that I runs fine from a dos/cmd manually that executes a shell script on a Linux box. I would love to have a button on an Access form that executes the same command using VBA.



    Here is the command I want to run that runs fine from a cmd window by running a script on the Linux box called UpdateTimesheet.sh.

    start C:\plink.exe -ssh -P 22 user@server -pw password echo %1 ^| sh -x "/bin/UpdateTimesheet.sh"

    I know about the Shell() command in vba, however, I think the double-quotes " in the path of the shell to run the command gets in the way.

    Any clues?

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Just use double quotes inside the path/parameter string:

    start C:\plink.exe -ssh -P 22 user@server -pw password echo %1 ^| sh -x ""/bin/UpdateTimesheet.sh""


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 06-29-2016, 02:56 PM
  2. Replies: 11
    Last Post: 11-13-2015, 05:11 PM
  3. Running query instead of showallrecords command
    By spleewars in forum Programming
    Replies: 2
    Last Post: 05-29-2012, 05:04 PM
  4. Replies: 1
    Last Post: 03-05-2011, 03:05 PM
  5. Pass command line parameters
    By lanto3000 in forum Access
    Replies: 2
    Last Post: 03-21-2010, 03:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums