Yes, the cmd file will be executed if in the startup folder.
You can also use a shortcut. Whatever you are most comfortable with
That will then run the vbs script to create the shortcut.
the VBS is almost identical to the VBA
Code:
' Based on code from https://msdn.microsoft.com/en-us/library/xsy6k3ys(v=vs.84).aspx
Dim WshShell
Dim strDesktop
Dim oShellLink
Set WshShell = CreateObject("WScript.Shell")
strDesktop = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(strDesktop & "\TestShortcut.lnk") 'modify as appropriate
'modify each of the values as appropriate
With oShellLink
.TargetPath = "C:\Users\Public\YourFileName.accdb"
.WindowStyle = 1
'.Hotkey = "Ctrl+Alt+f" 'optional
'.IconLocation = "notepad.exe, 0" ' for embedded icon
.IconLocation = "C:\__tmp\MIME\foo.ico" ' for specified .ico file
.Description = "My shortcut created by VBA" 'optional
.WorkingDirectory = strDesktop
'.Arguments = "C:\myFile.txt" 'optional
.Save
End With
Problem...problem.! The code is working fine as i told before but after the creation of the shortcut the my database is loading maximized....and user must select the maximize from window dialog every time when use the shortcut...