Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords:
Don't forget to check in your profile and in the all_users profile.
RegQueryValue(@REGCURRENT,"software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders[Startup]")I don't know if changing it will affect the actual startup. Also, another trick I tried with limited success was renaming all of the links to *.xyz, and then having a Winbatch close all the "Open With" boxes that pop up when Windows doesn't recognize the extensions. Good luck!
We make a winbatch script consisting of one line....
;---snip--- exit ;---snip---Then we pick a filetype, say *.xyz and associate xyz files with this script. Say it is compiled to xyz.exe
To associate...
rkey=RegOpenKey(@REGCLASSES,"") RegSetValue(rkey, ".xyz", "xyz_auto_file") RegSetValue(rkey,"xyz_auto_file\shell\open\command","c:\someplace\xyz.exe") RegSetValue(rkey,"%a%_auto_file","XYZ File") RegClosekey(rkey)Then to knock out the startup group. something like
startup=ShortCutDir("startup") DirChange(startup) FileMove("*.lnk","*.xyz",0)then to restore the startup group
startup=ShortCutDir("startup") DirChange(startup) FileMove("*.xyz","*.lnk",0)This will work if there are only LNK files in the startup group. If there are real exe's or data files it will keel over.
Then you can associate exe's to xy1 and com's to xy2 and so on. Just so you keep track to change them back. But then there are also "BAT" and "CMD" and it is even possible to define other exe extensions.
Pointing to an empty directory works in 9x I don't know about NT. You have to search the registry and point all your users to this empty directory. Unless there's something in NT that prevents moving the contents of the StartUp folders, I think its a better bet (you're only reading the registry, not modifying it).
When you read the Registry, you'll need to trap your query:
kPath = 'Software\Microsoft\windows\CurrentVersion\Explorer\User Shell Folders' kUser = regopenkey(@REGCURRENT, kPath) errormode(@off) lasterror() userVal = regqueryexpsz(kUser, '[StartUp]') errormode(@cancel) if lasterror() != 1233 then goto Cancel regclosekey(kUser)."[StartUp]" may not exist for the current user and the script will error out.
Article ID: W14406
Filename: Disable Startup Folder.txt
File Created: 2001:01:31:10:43:04
Last Updated: 2001:01:31:10:43:04