Prev: disable keyboard and mouse while running script
Next: how can get the netbios name of current domain before user logon?
From: Richard Mueller on 20 Sep 2006 22:08 Hi, Use "cmd /c" rather than "cmd /k". Once the script is working, you might want to make the window hidden, by using the optional parameter set to 0 (watch line wrapping): oShell.run "cmd /c CD C:\program files\bakbone software\netvault\util\ & nvblankmedia -barcode " & arrMediaBlank(2), 0 -- Richard Microsoft MVP Scripting and ADSI Hilltop Lab - http://www.rlmueller.net "Nick B" <ntbritton(a)cox.net> wrote in message news:2B9DF958-9855-4600-99EB-E513BEB5D296(a)microsoft.com... > Using the below script it will leave windows open. One for each tape it > blanks. > > How can i make it close the window? > > Const ForReading = 1 > > Set objFSO = CreateObject("Scripting.FileSystemObject") > Set objTextFile = objFSO.OpenTextFile("C:\program files\bakbone software\" > & _ > "netvault\scripts\testing\output.txt", ForReading) > > Wscript.Echo vbCrLf & "VS SVDL Blank Media" > > Do While objTextFile.AtEndOfStream <> True > strLine = objtextFile.ReadLine > If inStr(strLine, ",") Then > arrMediaBlank = split(strLine, ",") > Wscript.Echo vbCrLf & "medialabel: " & arrMediaBlank(0) > Wscript.Echo "group: " & arrMediaBlank(1) > Wscript.Echo "barcode: " & arrMediaBlank(2) > > Dim oShell > Set oShell = WScript.CreateObject ("WSCript.shell") > strcmd = "cmd /K CD C:\program files\bakbone software\netvault\util\ & > nvblankmedia -barcode " & arrMediaBlank(2) > oShell.run "cmd /K CD C:\program files\bakbone software\netvault\util\ & > nvblankmedia -barcode " & arrMediaBlank(2) > Set oShell = Nothing > WScript.Echo strcmd > i = i + 1 > End If > Loop > > Wscript.Echo vbCrLf & "Number of Tapes Blanked: " & i > > -- > Nick > > > "Nick B" wrote: > >> How can i use dos command line commands within a vbs script? >> >> Situation. >> >> I have a program that allows a command line interface. That allows for >> reporting and teh execution of commands. I need to be able to read text >> from >> a CSV file or tab sepearted file and add that data to a commmand line >> command >> to execute commands for the application with out any intervention from an >> operator. >> >> so i basicly just need to know how to use dos command line commands >> within a >> vbs script. >> >> Any ideas? >> >> >> -- >> Nick |