Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

running additional app in script.

Status
Not open for further replies.

paulk11

IS-IT--Management
Oct 11, 2007
11
GB
Dear all,

posted here yesterday,RE: The below script (Which works great.)
Now i need to call a new program (Password Generator Professional)

ive got this this:-
Which works from a new.vbs file.

how do i attach it to the bottom of my main script below..?
----------------------------------------------------------
' send commandline parameters to Password Generator Professional

Set wshShell = WScript.CreateObject ("WSCript.shell")

wshShell.run """C:\Program Files\Kristanix\Password Generator Professional\PGP.exe"" /output ""d:\get-group\newpasswords.txt"" /format ""$p"" /quantity 1600 /showmsg /unique /mask ""{N:n,3,3}{N:s,1,1}""", 6, True

set wshshell = nothing

----------------------------------------------------------

Option Explicit
Dim strCN, strFilter, objShell, strCmd, filePath
Dim oExcel, oSheet
' Prompt for group names and construct the filter.
strCN = ""
strFilter = "(|"
Do
strCN = InputBox("Enter Common Name of a group or Cancel", "Test")
If (strCN <> "") Then
strFilter = strFilter & "(memberOf=cn=" & strCN _
& ",ou=MYOU,dc=DOMAIN,dc=co,dc=uk)"
End If
Loop While strCN <> ""
strFilter = strFilter & ")"
' Use the WshShell object to run the csvde command.
If strFilter <> "(|)" Then
filePath = "d:\get-group\GroupMember.csv"
Set objShell = CreateObject("Wscript.Shell")
strCmd = "%comspec% /c csvde -f " & filePath & " -r """ & strFilter & """"
strCmd = strCmd & " -l givenName,userPrincipalName"
strCmd = strCmd & " -s SERVER.DOMAIN.co.UK"
objShell.Run strCmd, , True
'Deletes line 1 from GroupMember.csv
Const xlUp = -4162
Const xlLeft = -4131
Set oExcel = CreateObject("Excel.Application")
oExcel.Visible = True
oExcel.Workbooks.Open filePath
Set oSheet = oExcel.ActiveWorkbook.Worksheets(1)
oSheet.Rows(1).Delete xlUp
'deletes Column A from GroupMember.csv
oSheet.Columns(1).Delete xlLeft
Dim c
For Each c In oSheet.UsedRange.Columns(1).Cells
c.Value = Left(LCase(c), 3)
Next
' saves the file
oExcel.DisplayAlerts = False
oExcel.ActiveWorkbook.SaveAs filePath
oExcel.ActiveWorkbook.Close
oExcel.Quit
Set oSheet = Nothing
Set oExcel = Nothing
End If
-----------------------------------------------------------
 
GOT IT...!

-------------------------------------------------------
Next and final question, how do i append this output to COL A of my .CSV...
--------------------------------------------------------


' send commandline parameters to Password Generator Professional

Dim wshShell

Set wshShell = WScript.CreateObject ("WSCript.shell")

wshShell.run """C:\Program Files\Kristanix\Password Generator Professional\PGP.exe"" /output ""d:\get-group\newpasswords.txt"" /format ""$p"" /quantity 1600 /showmsg /unique /mask ""{N:n,3,3}{N:s,1,1}""", 6, True

set wshShell = nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top