1

I have an application that runs as a service. This application allows the user to connect and starts a subprocess under the user's windows account. In other words, mydomain\john connects to the service via TCP and says "launch" which starts a process on windows running under mydomain\john account.

Next, this subprocess is able to map drive T: using net use command. Then the process can run a VB script living on the mapped drive T:. No trouble so far. the problem arises when this VB script tries to run Excel using "createObject".

After setting DCOM launch settings with DCOMCNFG and creating the missing "Desktop" folder in the systemprofile folder, I still cannot get this to work. Oddly, if run my vb script and feed Excel a UNC path \fileserver\share1 rather than T:\ the script works.

Does anyone know why Excel would fail to access the T:\ mapping but have no issue with the UNC path?

  • I'm confused, why did you had to edit the System profile? didn't you say the script runs under a specific domain user? – EliadTech Apr 1 '15 at 7:48
  • Check this question: Map a network drive to be used by a service. One of the answers shows a way to map network drive for all users. – beatcracker Apr 3 '15 at 16:30
  • Running VBscript to call Excel or Word when VB script is started by a windows service leads you into a slew of challenges tying to the fact that you are not running as interactive desktop user. Running scheduled tasks hits the same set of issues. I discovered that starting in one of the newer versions windows, microsoft opted to seed the default user profile folders without the "desktop" folder. Creating this folder under systemprofile was a partial fix for some vbscript-office interaction. Now I can run Excel but cannot see the drives. Before I could not even run excel from my script. – John Leveille Apr 4 '15 at 17:57
  • I had the similar issue while using createObject I got H Drive could not be found while opening Excell xlsm.. IT must be due to previous incorrect UNC path/Mapped drive data in excel... By clearing XLSTART content I could get it fixed.. Here is the full document windowstechinfo.com/2016/01/… – Aravinda Jan 29 '16 at 7:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.