/build/static/layout/Breadcrumb_cap_w.png

Require vbscript to execute a command

Hi, 

I need vbs to Launch cmd and change directory to C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

type Regasm c:\temp\BARB2.EdxWebServiceClient.dll /tlb BARB2.EdxWebServiceClient.tlb /codebase

 

 


0 Comments   [ + ] Show comments

Answers (3)

Posted by: jdornan 11 years ago
Red Belt
0

Try this

Option Explicit
Dim wshShell
On Error Resume Next
   Set wshShell = WScript.CreateObject("WSCript.shell")
   If Err.Number <> 0 Then
      Wscript.Quit
   End If
   wshShell.Run "cmd.exe /C cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 & Regasm c:\temp\BARB2.EdxWebServiceClient.dll /tlb BARB2.EdxWebServiceClient.tlb /codebase"
On Error Goto 0
 
 
Posted by: anonymous_9363 11 years ago
Red Belt
0

Registering a DLL located in 'C:\TEMP' ranks right up there in the pantheon of Really Bad Ideas!

And does *nobody* know how to use Google? Jeeeeez...


Comments:
Posted by: M P 11 years ago
Purple Belt
0

Aside from the location of the DLL specified (I hope it was just filler for the real path), is there any specific reason that the script has to change the directory before executing the command?  Why not simply run the command with the full path like this:

 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Regasm.exe c:\temp\BARB2.EdxWebServiceClient.dll /tlb BARB2.EdxWebServiceClient.tlb /codebase
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ