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)
Please log in to answer
Posted by:
jdornan
11 years ago
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
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:
-
lol - jaybee96 11 years ago
Posted by:
M P
11 years ago
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