General discussion

Locked

Map Drive letters for access by Services

By Richard Lane ·
I have an application that I am trying to set up as a service on NT Server 4.0 SP6. I have created the service, added in the registry entries to get it to run correctly (Application and Working Directory). The application needs to run as System Account, interact with the desktop, but also needs to have access to a network share that has a pre-assigned drive letter (N: in this case). I have already set up the NullSessionShares entry of the other server, which allows the application access to the share when 'SysAccount' rather than a named user. When I start the service, the application starts fine, and runs as long as there is a user logged in, but when I log out, or restart the server, the application loses it's way. Does anyone know of a way that I can get the drive letter allocated prior to the service starting - registry entry for the service, some way of getting net use to run before the login processes?
Any help would be greatly appreciated as this is currently doing my head in!

Thanks

Richard

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Map Drive letters for access by Services

by SyscoKid In reply to Map Drive letters for acc ...

I wonder if you could use AutoExNT from the NT Resource Kit?

The AutoExNT service allows you to run a custom batch file, Autoexnt.bat, when you start a computer, without having to log on to that computer.

Collapse -

Map Drive letters for access by Services

by Richard Lane In reply to Map Drive letters for acc ...

Tried it, still won't allocate the drive letter to the required share.

Collapse -

Map Drive letters for access by Services

by Ewing Bettles In reply to Map Drive letters for acc ...

"Mapped" drives are only available through an authenticated user session. When a user logs off, the drive mappings go away, as they are associated with that particular users' profile. Since the ideal of a service is its functionality whether thereis an established user session or not, the service should incorporate mechanisms that are not dependent upon a user profile being loaded in the registry. In the case of drive mappings, the best solution would be to incorporate UNC paths instead of drive mappings.

For example, your service executable requires data from the N: drive. The N: drive is mapped to the SharedData directory on the server DataServe. Instead of using N:\data.txt, you could reference the same information using:

\\DataServe\SharedData\data.txt

This is the UNC form that does not require a dedicated drive mapping - syntax is specifically two backslashes followed by the computername of the computer with the shared resource, followed with a single backslash followed by the sharename of the resource, followed by another single backslash and the rest of the path necessary to get to the particular data in question.

Hope this helps, -Ewing

Collapse -

Map Drive letters for access by Services

by Richard Lane In reply to Map Drive letters for acc ...

Spoke with the App developers - software requires specific drive letter to run. Pain I know, but they won't change it! @#@$@#%%%@#@#@#@s

Collapse -

Map Drive letters for access by Services

by WalterP In reply to Map Drive letters for acc ...

You could try mapping a persistent connection under the system account. To do that schedule the net use command in at. e.g.

soon net use N: \\ServerName\ShareName password /USER:DomainName\UserName /PERSISTENT:YES

Where password and UserNamehave sufficient rights to the share.

This would also mean that you don't need to compromise security with the NullSessionShares stuff.

Cheers,
Walter.

Collapse -

Map Drive letters for access by Services

by Richard Lane In reply to Map Drive letters for acc ...

Tried it, but still the application won't run correctly. Have spoken with the developer and he will look at modifying the code (finally!)

Collapse -

Map Drive letters for access by Services

by Richard Lane In reply to Map Drive letters for acc ...

This question was closed by the author

Back to Windows Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums