Menu

Windows shortcuts, START, and MS Office

2022-04-13
2022-04-15
  • Glenn Knickerbocker

    I've got a Rexx program I use to start up all the shortcuts in a folder. I recently added a shortcut for MS Outlook, and suddenly START claims it can't find the file! Not the target of the shortcut, but the shortcut itself. Same thing happens when the target of the shortcut is any Office component:

    "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"
    "C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE"
    "C:\Program Files\Microsoft Office\root\Office16\MSACCESS.EXE"
    "C:\Program Files\Microsoft Office\root\Office16\ONENOTE.EXE"
    "C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE"
    "C:\Program Files\Microsoft Office\root\Office16\WINwORD.EXE"

    From the command line or a .CMD file, START works fine:

    start "" "Outlook.lnk"

    But when OORexx issues it:

    2 *-* 'start "" "Outlook.lnk"'
      >>>   "start "" "Outlook.lnk""
    

    I get a popup complaining:

    C:\gsk\startup\Outlook.lnk
    The specified path does not exist.

    Check the path, and then try again.

    and this message:

    The system cannot find the file C:\gsk\startup\Outlook.lnk.
    +++ "RC(1)"

    If I modify the same shortcut to issue any other command, it works fine. The command can even be a .CMD file or Rexx program that calls Office. Wrapping START in a .CMD file doesn't help, though. Any ideas what's going on here?

    ¬R

     
  • AvdP

    AvdP - 2022-04-14

    Hi Glenn,

    If you add a file with code to reproduce this error, and also mention your oRexx and Windows versions you will probably get quicker and better response to your questions.

     
  • Glenn Knickerbocker

    'start "" "Outlook.lnk"'
    is the complete Rexx code required to reproduce the error.

    Outlook.lnk is a Windows shortcut with a target of OUTLOOK.EXE as installed on my machine:
    "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE"
    I'll attach a renamed copy here (the attachment dialog insists on resolving the shortcut and won't let me attach the actual shortcut file), but of course it won't be any use on a machine where Outlook is installed in a different directory.

    I'm running on Microsoft Windows 10 Enterprise, 10.0.19044 Build 19044.
    I upgraded ooRexx from 4.2 to the current 5.0 beta and there was no change in this behavior.

     
    • Glenn Knickerbocker

      Well, I found a workaround that doesn't involve an extra file, at least: The shortcut itself can wrap OUTLOOK.EXE in another START command. Starting the shortcut from Rexx works if I make this the target of the shortcut:

      C:\Windows\System32\cmd.exe /c start "" "C:\Program Files\Microsoft Office\root\Office16\OUTLOOK.EXE" /select outlook:Inbox

      I also found that using START in the command string issued by Rexx isn't necessary. I think it was in Windows 7, but now I can just issue the shortcut's filename as the command. I get the same "not found" error either way.

       
      • Erich

        Erich - 2022-04-15

        Hi Glenn,
        if I create an Outlook shortcut on the Desktop, I can successfully start
        and//or run it from rexx.
        Where comes " C:\gsk\startup\Outlook.lnk" into play? Do you run your Rexx
        program from within this directory?
        Did you verify the exact file reported exists?
        Can you re-create a Shortcut in a different directory where no Admin is
        required and try again?

         
        • Glenn Knickerbocker

          Yep, in my testing I'm running the Rexx program in "C:\gsk\startup\", and "C:\gsk\startup\Outlook.lnk" is the shortcut file. I created and own the C:\gsk directory.

          The original error in production was in a directory under my user directory: "C:\Users\GlennKnickerbocker\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\temp".

          I tried it just now on the desktop with the same results. I created a new Outlook shortcut and startoutlook.rex on the desktop, and startoutlook.rex gave this trace:

             +++ "WindowsNT COMMAND C:\Users\GlennKnickerbocker\Desktop\startoutlook.rex"
           2 *-* 'dir outlook.lnk'
             >>>   "dir outlook.lnk"
          

          Volume in drive C is Windows
          Volume Serial Number is 0628-0568

          Directory of C:\Users\GlennKnickerbocker\Desktop

          04/15/2022 02:18 PM 1,823 OUTLOOK.lnk
          1 File(s) 1,823 bytes
          0 Dir(s) 194,880,991,232 bytes free
          +++ Interactive trace. "Trace Off" to end debug, ENTER to continue. +++

           3 *-* 'start "" outlook.lnk'
             >>>   "start "" outlook.lnk"
          

          The system cannot find the file C:\Users\GlennKnickerbocker\Desktop\OUTLOOK.lnk.
          +++ "RC(1)"

           

          Last edit: Glenn Knickerbocker 2022-04-15

Log in to post a comment.