I do not like the shell entries, in the end the stuck my registry. I prefer the send to. This script adds (& deletes) itself from the send to folder of the current user
Code:
#singleinstance force
IfLess, 0, 1
If A_IsCompiled
{
SendToDir = %UserProfile%\SendTo
IfNotExist, %SendToDir%
{
MsgBox, 16,, %SendToDir% not found
ExitApp
}
StringTrimRight, ScriptName, A_ScriptName, 4
IfExist, %SendToDir%\%ScriptName%.lnk
{
FileDelete, %SendToDir%\%ScriptName%.lnk
MsgBox, 64,, Shortcut %SendToDir%\%ScriptName%.lnk deleted
}
else
{
FileCreateShortcut, %A_ScriptFullPath%, %SendToDir%\%ScriptName%.lnk
, %A_ScriptDir%,,Send to Clipboard as Name,,%A_ScriptFullPath%
MsgBox, 64,, Shortcut %SendToDir%\%ScriptName%.lnk generated
}
ExitApp
}
else
{
MsgBox, 16,, Compile me.
ExitApp
}
Loop, %0% ; For each parameter:
{
File := %A_Index%
CommentFile = %File%.txt
IfNotExist, %File%
{
MsgBox, 16,, Error: %File% not found
Continue
}
SplitPath, File, File
FileAppend, |%File%> %A_Now% (%A_UserName% on %A_Computername%)`n, %CommentFile%
If ErrorLevel
{
MsgBox, 16,, Error writing %CommentFile%
Break
}
Run, "%CommentFile%",, UseErrorLevel
If ErrorLevel
{
MsgBox, 16,, Error starting %CommentFile%
Break
}
If (%0% > 1 and %A_Index% < %0%)
{
MsgBox, 4129, Procesing %A_Index% (%0%), Next File?
IfMsgBox, Cancel
Break
}
}
If interested, it has two companions: send to clipboard as name (posted here) and send to clipboard as content (not posted here, I think a very special one, if interested, send me a message)