Search found 1789 matches

by jhicks
Mon May 21, 2007 9:42 pm
Forum: VBScript
Topic: Querying from an SQL Database using VBScript
Replies: 2
Views: 19386

Querying from an SQL Database using VBScript

Here's something to get you started: Dim objCN, strConnection Set objCN = CreateObject("ADODB.Connection") strConnection = "Driver={SQL Server};Server=TRINITY;Database=NorthWind;Trusted_Connection=TRUE" objCN.Open strConnection Dim strSQLQuery strSQLQuery = "Select * from Employees" '"SELECT * FROM ...
by jhicks
Mon May 21, 2007 2:06 am
Forum: VBScript
Topic: WMI Querying
Replies: 2
Views: 2741

WMI Querying

WMI doesn't offer that functionality, although it sure would be handy. One workaround would be to return everything where local=false. Then as you enumerate the returned collection, only use the object if an InStr function, is true for what you are looking for. Or you might use regular expression ma...
by jhicks
Mon May 21, 2007 12:43 am
Forum: PrimalScript
Topic: MOM.ScriptAPI
Replies: 6
Views: 2680

MOM.ScriptAPI

What version of MOM do you have installed?
by jhicks
Wed May 16, 2007 2:34 am
Forum: PrimalScript
Topic: Powershell output window
Replies: 7
Views: 1980

Powershell output window

Go back into PrimalScript and check the box to capture output for the PowerShell language and try again. Also, what is the script doing? Some things can't be captured, like Read-Host.
by jhicks
Wed May 16, 2007 2:15 am
Forum: VBScript
Topic: VBScript to ftp a server!!
Replies: 3
Views: 15970

VBScript to ftp a server!!

I forgot that FTP unfortunately doesn't do StdOut the way VBScript expects it. Using the Exec method and StdOut won't work with FTP.But if you are using an answer file authentication shouldn't be an issue or something you have to monitor. Otherwise, 3rd party is the way to go.
by jhicks
Tue May 15, 2007 11:25 pm
Forum: PrimalScript
Topic: Powershell output window
Replies: 7
Views: 1980

Powershell output window

Go to Tools - Options - General and click Redirect Output to View. Then, still in Options, go to Environment - Languages and find Windows Powershell in the list. Check the Capture Output box. OK your way out of options and you should be good to go.
by jhicks
Tue May 15, 2007 10:35 pm
Forum: VBScript
Topic: Problem with Print Server script
Replies: 1
Views: 4379

Problem with Print Server script

On NT, WMI was not installed by default. You have to install the WMI core files which you can download from Microsoft. A reboot will be required and once installed, WMI can not be uninstalled.
by jhicks
Mon May 14, 2007 6:34 am
Forum: VBScript
Topic: DFS Remap Script
Replies: 4
Views: 4670

DFS Remap Script

That's to be expected. This code is logically incorrect. You only need to remove the drive if it already exists but you always want to map drive V:This is how your code should look:If StrComp("V:", kingcobra) = 0 Then 'remove the existing share objNetwork.RemoveNetworkDrive "V:", True, True 'give op...
by jhicks
Mon May 14, 2007 5:46 am
Forum: VBScript
Topic: DFS Remap Script
Replies: 4
Views: 4670

DFS Remap Script

I just realized you have a logic error. You only map the new drive if the old one exists. After you remove the old mapping there is no place where the new drive mapping is added. Here's another approach plus the correct logic: Set objFSO=CreateObject("Scripting.FileSystemObject") Set objNetwork=Crea...
by jhicks
Wed May 02, 2007 10:29 pm
Forum: VBScript
Topic: Move printers
Replies: 9
Views: 5780

Move printers

Use a logon script and the WshNetwork object. Enumerate the printer connections. If you find a match to the old printer, remove the printer connection then use the AddwindowsPrinterConnection method to add the new printer.