Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: shortcutdir desktop profiles
ShortcutMake("pptview.lnk.", "c:\windows\desktop","","c:\flip", @NORMAL)I am getting a create error message, in the case of PC's where there are multiple user profiles (ie. many users sharing the same PC). In such case, the shortcuts failed to appear on the Desktop.
How do I check the existence of multiple profiles ? how do I know which profile is currently active ?
desktop=ShortCutDir("Desktop") ; following line *might* needs a \ in the middle lnkfile=strcat(desktop,"pptview.lnk") target="c:\flip\pptview.exe") ShortcutMake(lnkfile, target,"","c:\flip", @NORMAL)The ShortcutDir("Desktop") function gives the directory of the current user's Desktop. It searches a particular place in the registry, below, which is a more universal method of finding out the desktop (look up Winbatch Registry commands and discussion).
UserDir = RegQueryValue(@REGCURRENT, "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Desktop]")works for all versions of Winbatch 32bit.
The following work for the current user only. If you want the Default user to get it, the answer is:
DefaultDir = RegQueryValue(@REGUSERS, ".Default\Software\Microsoft\Windows\CurrentVersion\Explorer\ShellFolders[Desktop]")In the case above, you may need to copy all .LNK files from DefaultDir to UserDir on login if you want users to have all the default icons.
Look in Regedit under RegUsers and you will see 1 or 2 keys. If you see one key, it will be .Default, and this equals @REGCURRENT (Current user).
If you see two keys, then the other one is used and is the logged in username and that key and subkeys equals @REGCURRENT.
Pick up a good beginner's book on the Registry for more information.
Get the userid from the registry:
userid=RegQueryValue(@REGMACHINE, "SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon\[DefaultUserName]") change to the desired directory then shortcutmake to create the icon DirChange("C:\Winnt\Profiles\All Users\Start Menu\Programs\Startup") ShortcutMake("QuotaB.lnk", "C:\Winbatch\QuotaB.exe", "", "C:\Winbatch", @NORMAL)and include %userid% in the new shortcut somewhere
Article ID: W13849
Filename: Profiles and Making Shortcuts on the Desktop.txt
File Created: 1999:04:15:16:56:48
Last Updated: 1999:04:15:16:56:48