Jump to content

Recommended Posts

Posted (edited)

This code:

$script = StringSplit(@ScriptName, '.')
$link = '%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\' & $script[1] & '.lnk'
ConsoleWrite('path: ' & @ScriptFullPath & @CRLF)
ConsoleWrite('link: ' & $link & @CRLF)
If Not FileExists($link) Then
    If MsgBox($MB_YESNO, $script[1], 'Add ' & $script[1] & ' to startup?', 'Y') = $IDYES Then
        FileCreateShortcut(@ScriptFullPath,$link)
        ConsoleWrite(@error&' @error'&@CRLF&@extended&' @extended'&@CRLF)
    EndIf
EndIf

Yields:

path: C:\Users\jallen\Documents\AutoIT\SmartCapsLock.au3
link: %appdata%\Microsoft\Windows\Start Menu\Programs\Startup\SmartCapsLock.lnk
0 @error
0 @extended

I don't think it's a priv thing because (a) it's my own startup folder (b) I can create the shortcut manually in explorer and (c) I HAVE ADMIN!

Edited by jaja714
add $script = StringSplit(@ScriptName, '.')

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...