I stumbled upon this post while researching a related need, and I think it is possible to assign the Subst in a Global User (System / NT Authority) context, but not directly.
Following from this: http://msdn.microsoft.com/en-us/library/aa363908%28v=VS.85%29.aspx
...it seems you can instantiate a subst globally via either the api or possibly directly in the registry using the DefineDosDevice function or method. Sorry, I do not know how this may or may not apply to Win Servers, however...
My problem was attempting to use subst for a folder for apache, which needs to see the mount as system user, or globally (so subst doesn't work). Any way you try to do a subst, even using something such as RunAsSystem, will fail to produce a viable result.
However, I found that by creating the DosDevice in the registry I have a viable 'subst' mount that apache/mysql/php-win can use.
Example: subst S: C:\PortableUSB
asA.reg file...
[code]
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]
"S:"="\\??\\C:\\PortableUSB"
[/code]
Or, in the registry it will look like this (so you can manually add it this way)...
A String Name of "S:" (without the quotes. Use your preferred DriveLetter, of course)
This String's Value is "\??\C:\PortableUSB" (without the quotes. Use your own path, of course)
Requires a restart. The subst is persistent and available globally. I do not yet know how reliable it is, but I am using it with success so far.
-----------
I hope this is not inappropriately posted, seeing as how this is a server newsgroup and I am doing this in XP, but info on this is scant to find, and this is one of the few hits discussing this issue - I feel it may be helpful to others investigating this sort of thing.
cheers, twohawks
Post by Synapse SyndromeCan the SUBST command be used on a startup script, or only a logon script?
ie. Can these mappings be used remotely on the server, when no user has
logged in?
ss.
Post by Pegasus (MVP)If subst.exe gave you a globally accessible drive then this would
consistitute a big security breach - but why don't you give it a try
yourself? You can use runas.exe to test the visibility of the substituted
drive.
Post by Synapse SyndromeI was just hoping that somebody would know for sure, but it does seem
unlikely now, with the implication you just raised.
I cannot check myself at the moment, because I am in the middle of a major
reconfiguration, and I was just thinking about possibilities of how I can
sort this out.
I am using a NAS-like appliance (Drobo), that seems to only be able to show
all the contained disks as a very large striped partition. I was hoping
that making virtual drives would make it easier to sort the types of data in
the array.
ss.
Post by Synapse SyndromeIs there any way a service can be used to run a script for certain user
accounts without having to log in with those accounts?
ss.
Post by Pegasus (MVP)It depends on what you want the script to do.
Post by Synapse SyndromeI want it to make virtual drives for two user groups using the SUBST
command.
ss.
Post by Pegasus (MVP)You need to place the subst.exe or net.exe commands into the
individual user's logon script.
Post by Bruce SandersonTo elaborate on what Pegasus said, like Mapped Network Drives, the mappings
created by the subst command are artifacts of the user's Windows Session,
not the OS environment. When a user logs on, their Windows Session is
created. If there are "persistent" Mapped Network Drives" in the user's
profile, they will be recreated automatically. The mapping made by subst
are not persistent so will not be recreated automatically.
Since the mappings are an artifact of the user's Windows Session there is no
way to make them apply to anyone that logs on, without arranging for the
subst command to be re-issued as part of the logon process - e.g. in a logon
script.
If you want the subst mapping to apply to anyone that logs on to a
particular computer, you can put the subst command in a .cmd file in the All
Users, Start Menu, Programs, Startup since anything there will be executed
as part of the logon process for any user that logs on to that computer.
--
Bruce Sanderson
http://members.shaw.ca/bsanders
It is perfectly useless to know the right answer to the wrong question.
Submitted via EggHeadCafe
Excel Generate High Quality RoadMaps
http://www.eggheadcafe.com/tutorials/aspnet/3310004f-e1ae-45a7-9bea-7b2b970d1230/excel-generate-high-quality-roadmaps.aspx