+ Reply to Thread
Results 1 to 3 of 3

Hyperlink to local file with argument

  1. #1
    Registered User
    Join Date
    12-10-2008
    Location
    Aberdeen
    MS-Off Ver
    MS365 VER 2308
    Posts
    82

    Hyperlink to local file with argument

    I'm trying to hyperlink to a local (network) batch file - which I now have working.

    \\server\folder\file.bat

    The problem is that I need to pass an argument to that file via the link...

    \\server\folder\file.bat arg1

    Now when I click on it, I get "cannot open file".

    Can anyone help?

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,244

    Re: Hyperlink to local file with argument

    My idea - You need to create two bat files:

    1. The first will contain the path to the bat "executable" (the second bat) along with an argument for it
    2. The second will contain the appropriate control commands and will take the argument passed by the first file

    You create the hyperlink for the first bat file.

    So, for example:

    I. 1st bat named "1a.bat" (placed in any location) ===> hyperlink for him
    Please Login or Register  to view this content.
    II. 2nd bat ("executable") named "2a.bat" (here: placed in 'C:\Temp')
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-10-2008
    Location
    Aberdeen
    MS-Off Ver
    MS365 VER 2308
    Posts
    82

    Re: Hyperlink to local file with argument

    I need to pass the argument as part of the intial link.
    I will have MANY hyperlinks, all of which will "link" to the same batch file, but all of which need to include different argument.

    eg
    \\server\folder\file.bat data1
    \\server\folder\file.bat data2
    \\server\folder\file.bat data3
    \\server\folder\file.bat data4

    File.bat will then carry out an operation using either data1, data2, data3, data4 depending on the argument received.

    I cannot have file1.bat, file2.bat, file3.bat, file4.bat and so on.

    I wonder if I just put %20 in place of the space... ...nah, that didn't work
    Last edited by bluphoto; 02-10-2021 at 12:56 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to copy server file into local folder, and change data sources to this new file
    By rickywangca in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2019, 11:18 AM
  2. hyperlink to attached files on local pc
    By mgeruis in forum Excel General
    Replies: 0
    Last Post: 05-15-2019, 10:15 PM
  3. Hyperlink to local Excel document and pass parameter
    By antoineburdett in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2018, 08:50 AM
  4. VBA Search for Keywords in Local Drive and Create Hyperlink
    By mohammedismail in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2015, 06:33 AM
  5. How to create a hyperlink to a local pdf file using Excel 2008 for Mac OSX?
    By BlackCatBone in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 1
    Last Post: 11-01-2013, 07:56 PM
  6. [SOLVED] Extracting all hyperlink images to local disk in Excel 2010
    By cejamgr in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 02-14-2013, 12:11 PM
  7. [SOLVED] Hyperlink to local image file doesn't open ?
    By aSchwarzie in forum Excel General
    Replies: 0
    Last Post: 01-01-2006, 05:55 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1