# PSTools step failing

**URL:** https://www.finalbuilder.com/forums/t/pstools-step-failing/4290
**Category:** Discussion
**Created:** [October 31, 2007, 2:21am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290 "2007-10-31T02:21:40Z")
**Posts on this page:** 8
**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: [October 31, 2007, 2:21am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/1 "2007-10-31T02:21:40Z")

</div>

I'm trying to use PSTools to set the .Net version of a web site. My script builds a folder, creates an IIS Virtual Directory from that folder, copies a standard test file (not .Net) into the folder, then runs PSTools to register the site as .Net 2.0. The PSTools step fails. The script is&nbsp;attached. Hopefully the script and log files are attached as zip files.

[Web20Log.zip](https://www.finalbuilder.com/forums/uploads/default/original/2X/4/45fa79d57c710e967fd9d0dd59a589b300732c91.zip) (33.242 KB)[Web20script.zip](https://www.finalbuilder.com/forums/uploads/default/original/2X/1/1bd639e6a4d5e65d11a211b82038b87e858dbd62.zip) (3.474 KB)

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [November 1, 2007, 6:56am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/2 "2007-11-01T06:56:14Z")

</div>

Hi Richard,   
  
 Here’s the error (for other people’s benefit).   
  
 \> PsExec could not start C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s W3SVC/1/ROOT/EmailHeirarchy on ad1hfdadm902:   
 \> Return code : 3   
  
 According to MSDN, a return code of 3 means that the path can’t be found.   
 [http://msdn2.microsoft.com/en-us/library/ms681382.aspx](http://msdn2.microsoft.com/en-us/library/ms681382.aspx)   
  
 hope that helps…

---

<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: [November 1, 2007, 1:39am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/3 "2007-11-01T01:39:28Z")

</div>

How do I determine the correct path relative to W3SVC? I know the file path (E:\web\EmailHeirarchy), but I don’t know how to determine the path as coded above. I just copied that from another script that worked but it was from a different server with a different virtual directory name.

---

<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: [November 1, 2007, 2:01am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/4 "2007-11-01T02:01:12Z")

</div>

According to the IIS Metabase Explorer the app root is /LM/W3SVC/1/Root/EmailHeirarchy. I tried that and the command failed. That confirmed to me that the original /W3SVC/1/Root/EmailHeirarchy might have been correct so I retried that and the command failed.   
  
 Any suggestions?

---

<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: [November 2, 2007, 12:22pm UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/5 "2007-11-02T12:22:26Z")

</div>

Hi Richard,   
  
 The return code of 3 suggests that the path to aspnet\_regiis.exe is incorrect. Which operating system are you running on the remote machine and which version of the .Net framework are you trying to register?   
  
 As a test, run “C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe” at a command prompt on the remote machine to see if the path exists.   
  
 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: [November 2, 2007, 1:34am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/6 "2007-11-02T01:34:57Z")

</div>

Here’s the output from running the command with -LK to list the Virtual Directories registered:   
  
 W3SVC/1.1.4322.2407   
 W3SVC/1/ROOT/1.1.4322.2407   
 W3SVC/1/ROOT/DirectoryLookup/2.0.50727.0   
 W3SVC/1/ROOT/ERABS/1.1.4322.2407   
 W3SVC/1/ROOT/HTSCBA/Artifacts/1.1.4322.2407   
 W3SVC/1/ROOT/HTSCBA/Lessons/1.1.4322.2407   
 W3SVC/1/ROOT/VendorBadgeRequest/2.0.50727.0   
 W3SVC/1/ROOT/EmailHeirarchy/2.0.50727.0   
  
 THe original command run was :   
  
 C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s W3SVC/1/ROOT/EmailHeirarchy   
  
 so it should have worked, unless the trailling “/” is required.   
  
 The vdir is set to 2.0 because I set it manually via IIS manager on the server.

---

<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: [November 2, 2007, 2:31am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/7 "2007-11-02T02:31:43Z")

</div>

I created a new site: Test20fix. I tried:   
  
 C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s W3SVC/1/ROOT/Test20fix   
 C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s /W3SVC/1/ROOT/Test20fix   
 C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s /W3SVC/1/ROOT/Test20fix/   
 C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s W3SVC/1/ROOT/Test20fix/   
  
 via PSTools and none of them worked.   
  
 I ran C:\WINDOWS\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe -s W3SVC/1/ROOT/Test20fix directly on the server and it worked.   
  
 Is there something wrong with my PSTools config to execute on the remote server? The server name is correct and I left the credentials blank to use the current credentials which are the same I use to login to the server console…   
  
 This is a buy/no buy decision and getting this script to work is the critical point.

---

<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: [November 5, 2007, 2:17am UTC](https://www.finalbuilder.com/forums/t/pstools-step-failing/4290/8 "2007-11-05T02:17:27Z")

</div>

Hi Richard,   
  
 Sorry I didn’t pick up on this earlier, you will need to put the command parameters in the ‘Parameters’ field of the action, not in the ‘Program File’ field.   
  
 So the action properties should be:   
  
 Program File: C:\Windows\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727\aspnet\_regiis.exe   
 Parameters: -s W3SVC/1/ROOT/Test20Fix   
 Start In: C:\Windows\[Microsoft.Net](http://Microsoft.Net)\Framework\v2.0.50727   
  
 Regards,   
 Paul.
