Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8277477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:42:07+00:00 2026-06-08T08:42:07+00:00

I am creating a shortcut using WshShell VS2010 .Net 4 and ant to be

  • 0

I am creating a shortcut using WshShell VS2010 .Net 4 and ant to be able to create a target path that has a reference to AccessRuntinme then our application. This is what I have so far with no errors untill I run the program and click the button.

 private void CreateShortCut64()
    {
        object shDesktop = (object)"Desktop";
        WshShell shell = new WshShell();
        string shortcutAddress = (string)shell.SpecialFolders.Item(ref shDesktop) + @"\LinkName.lnk";
        IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
        string targetPath64 = "\"C:\\Program Files (x86)\\Microsoft Office\\Office12\\MSACCESS.EXE\" \"C:\\Program Files (x86)\\My Program\\Prog.accdr\"";
        shortcut.Description = "Program";
        shortcut.Hotkey = "Ctrl+Shift+A";
        shortcut.TargetPath = targetPath64;
        shortcut.IconLocation = "c:\\Program Files (x86)\\My Program\\" + @"\Prog.ico";
        shortcut.Save();
    }

The above example works fine if I leave out the reference to Access Runtime and just have My Program as the target but I want to have both in the target which works fine when you edit the target through windows.

Any help will be much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:42:09+00:00Added an answer on June 8, 2026 at 8:42 am

    I suspect that it is because you are not setting MS Access to run-time mode:

    "C:\Program Files (x86)\Microsoft Office\Office12\MSACCESS.EXE" /runtime "C:\Program Files (x86)\My Program\Prog.accdr"
    

    Edit re comments

    shortcut.TargetPath = "\"C:\\Program Files (x86)\\Microsoft Office\\Office12\\MSACCESS.EXE\";
    shortcut.Arguments = "\"C:\\Program Files (x86)\\My Program\\Prog.accdr\" /runtime";
    

    I tested with MS Access 2010 x64 installed, so the path names are different, otherwise the code is pretty similar to the OP.

    object shDesktop = (object)"Desktop";
    WshShell shell = new WshShell();
    string shortcutAddress = (string)shell.SpecialFolders.Item(ref shDesktop) + @"\LinkName.lnk";
    IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(shortcutAddress);
    shortcut.Description = "Program";
    shortcut.Hotkey = "Ctrl+Shift+A";
    shortcut.TargetPath = "\"C:\\Program Files\\Microsoft Office\\Office14\\MSACCESS.EXE\"";
    shortcut.Arguments = "\"C:\\Program Files (x86)\\My Program\\Prog.accdr\"  /runtime";
    shortcut.IconLocation = "c:\\Program Files (x86)\\Abtrac\\" + @"\Prog.ico";
    shortcut.Save();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating some desktop application using WPF(C# .net). I want to create it as
I would like to create a shortcut on the desktop using VBScript code. I
How can I set the start in path for a shortcut? I am creating
Is it possible to create a macro in Notepad++ that is able to utilize
We are creating a site template that among other things has a Document library
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
Creating a simple RPG game, first time using XNA. Trying to get my character
Someone can explain this error? Error Creating Control - head Object reference not set
In WIX, how do you create a non advertised shortcut in the allusers profile?
I have been using Eclipse for a long time, the feature that is less

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.