Announcement

Collapse
No announcement yet.

Syntax using shell:startup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Syntax using shell:startup

    Syntax question for Setup Factory

    File.Move("%AppFolder%\\file_name.exe", "shell:startup", true, true, false, false, nil);

    The file does not move to that location when constructed as above, shell:startup is actually
    C:\Users\user\AppData\Roaming\Microsoft\Windows\St art Menu\Programs\Startup where user will not be the same computer to computer but shell:startup is a constant

  • #2
    This is the correct code for moving a file named sample.exe to the user's startup folder:
    Code:
    File.Move(SessionVar.Expand("%AppFolder%\\sample.exe"), SessionVar.Expand("%StartupFolder%"));
    However, what you actually want is most likely this:
    Code:
    Shell.CreateShortcut(SessionVar.Expand("%StartupFolder%"), "My caption", SessionVar.Expand("%AppFolder%\\sample.exe"));
    This will create a shortcut to the installed application, and run it in the source folder. Also, this shortcut needs to be deleted in the On Pre Uninstall event during removal.

    And if this was indeed your intention, then you could do all this without writing any code, just by checking the "Startup" option for the shortcuts in the file properties:

    Click image for larger version  Name:	SCRN-2020-09-14-01.png Views:	1 Size:	14.9 KB ID:	305461

    Ulrich

    Comment


    • #3
      Thank you Ulrich. The "startup" option was, as you said, a simple no code solution.

      Comment

      Working...
      X