# Trouble with subst when using FBCMD.exe

**URL:** https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488
**Category:** Discussion
**Created:** [June 12, 2007, 4:30am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488 "2007-06-12T04:30:14Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 12, 2007, 4:30am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/1 "2007-06-12T04:30:14Z")

</div>

Hi,

I wrote a windows service to connect our system with FinalBuilder. FBCMD.exe is called by the following lines (C#):

Process objProcess = new Process();  
objProcess.StartInfo.FileName = sConfig.strPathFinalBuilder;  
objProcess.StartInfo.Arguments = strParams.ToString();  
objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;  
objProcess.Start();  
objProcess.WaitForExit();

&nbsp;

The FinalBuilder project I use&nbsp;has some script lines like:

CreateObject("Scripting.FileSystemObject").DriveExists("t")

which suddenly failed.

&nbsp;

I checked it from outside. My test-script failed for all drives mapped by the FinalBuilder-process which was started from the windows service.

What have I to do? Which permissions must be set and where?

&nbsp;

Thanks. Regards,

Christian

---

<div class="post-metadata">

### Author: ![paulsamways](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/p/e8c25b/32.png) [@paulsamways](https://www.finalbuilder.com/forums/u/paulsamways)
#### Post date: [June 13, 2007, 1:16am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/2 "2007-06-13T01:16:48Z")

</div>

Hi Chistian,   
  
You will need to use the "Subst Drive" action in your FinalBuilder project before any actions attempt to read from the drive.&nbsp;The reason for this is that&nbsp;subst drives are configured on a per user basis, they are not shared between user accounts.   
  
Regards,   
Paul.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 13, 2007, 9:43am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/3 "2007-06-13T09:43:10Z")

</div>

Hi Paul,   
  
 it seems to be a little bit more tricky. Until now, the problem occurred only a single time. My project looks like:   
 1. create directory (randomly named via variable)   
 2. remove mapping from “T:” ( Condition: CreateObject(“Scripting.FileSystemObject”).DriveExists(“t”) )   
 3. map directory on “T:”   
 4. …   
  
 The problem was, that the condition (2) failed and the mapping was not removed. But a mapping for “T:” already exists so (3) failed. I could see the mapping for “T:” using “subst” on the command line. But even my new created test script did not found anything. I could remove the mapping by hand using “subst t: /d”. After that, I mapped the same directory by hand and suddently it detected by the script. I tried my windows service a few more times after that, but it worked normal. Weird.   
  
 Regards,   
  
 Christian

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 14, 2007, 2:57am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/4 "2007-06-14T02:57:55Z")

</div>

Funny but I had the same problem with my nightly build, also mapped to t: . This is the relevant part from the log :

[Unmap Network Drive [T:]]  
Command line : net use T: /yes /delete  
The network connection could not be found.

More help is available by typing NET HELPMSG 2250.

Action Failed with Return Code : 2

[Map Drive T [\\MRBUILDER\ExternalBuilds\3.9.0]]  
Error : Drive T: already exists.

The deletion of&nbsp; T didn't succeed.

Thanks Daphna

&nbsp;

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [June 15, 2007, 2:16am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/5 "2007-06-15T02:16:24Z")

</div>

Hi Daphna,

In your case, is it possible that the mapping was created by a different user to the user who tried to delete it? I think this might explain what was going on...

&nbsp;

Christian,

I'm glad you got yours working OK!

&nbsp;

Regards,

Angus

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 17, 2007, 9:54am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/6 "2007-06-17T09:54:20Z")

</div>

Sometimes I run the Interactive program and sometimes the Batch mode, but always from my user (Daphna), does it matter?   
 Daphna

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [June 20, 2007, 4:13am UTC](https://www.finalbuilder.com/forums/t/trouble-with-subst-when-using-fbcmd-exe/488/7 "2007-06-20T04:13:17Z")

</div>

Hi,   
  
 it happend again. I had to stop the service.   
  
 Regards,   
  
 Christian
