vbscript

Vbscript - Installing fonts (Font is already installed, overwrite?)

I'm trying to deploy fonts to several computers in an organization. And at first I thought that a simple copy would do the job. Turns out it didnt. So I changed the script to use CopyHere method instead taken from objShell.Namespace This does work when the font isn't installed at all. But when it is, I get this annoying error message ...

When will Folder.Size not work in VBScript

http://stackoverflow.com/questions/3871260/how-to-get-the-size-of-the-network-folder-in-asp I have mentioned my problem on the above link and so far I have come to the conclusion that possibly a Folder has been given Protection rights because of which I cannot get it's Folder.Size in vbscript using FileSystem object.Can anyone shed ligh...

Check if Excel workbook is open using VBScript

I have a vbs script which writes to an Excel spreadsheet. To be able to save the spreadsheet I need to ensure that it is not already open. Can someone suggest the best way to do this? Some research: I tried to create a Word Tasks objects to show me all running processes, but on Windows 7 it only tells me whether Excel is running or...

Using VBScript how can I check if the Spooler service is started and if not start it?

Hi all, I'd like to use VBScript to check if the Spooler service is started and if not start it, the code below checks the service status but I need some help modifying this so I can check if it is started. strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\c...

Writing to the Windows Event Log vbs

Hi Folks, I am trying to write to the Windows Event Log (Win2k8 R2) from vbs. I am a complete novice to vbs by the way! I have a script that I am running that does xyx and I want to put some logging in there. Script: ' VBScript source code Option Explicit HostInstanceFailover Sub HostInstanceFailover() WScript.Echo "Entering Hos...

VBscript - SQL Connection fails SQL Server does not exist or access denied

Hi, this is pretty strange. I've got this string that connect to a SQLServer in the same domain as the computers are running and compares username with employeeID. Then takes that row and dumps it into the lokal computers registry. This is working in Windows XP, but not Windows 7 it seems. I get this exact error message: Line:39 Char:...

Group file to New Folder?

I have to copy files, make a new folder and then paste those files into the new folder so often. I wonder if we can make a batch file or vbscript file to perform this task? Just select the files and choose "Group to New Folder" from the context menu. That'll be awesome! ...

Get List of computers in Workgroup using WMI VBScript

Hi All, I need all the computers in the WORKGROUP. I tried the Dim objComputers Set objComputers = GetObject("WinNT://WORKGROUP") But it is Active Directory object. Is there any way to get the computers without WinNT://? Thanks in advance -Ganesh ...

Output each line of text (+ the first line) to its own .txt file VBS-Script

I need a VBS script to output the first line of text along with another line of text for file data.txt. example of my text.txt file line1 + line2 to 1.txt line1 + line3 to 2.txt line1 + line4 to 3.txt Thanks in advance, Best regards, joe ...

How can you set focus to an inputbox with PowerShell?

I'm using the following PowerShell 2.0 code to grab input from a vb inputbox: [void][System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') $name = [Microsoft.VisualBasic.Interaction]::InputBox("What is your name?", "Name", "bob") Sometimes when I run it the input box appears behind the active window. Is there a way...

When accessing a logical drive's space status, the total drive results are correct, but the free space results are not

The problem appears to be with the The Win32_LogicalDisk class' free space property as it is showing only what the currently logged in user has rights to, not what free space actually exists. Example code, though not entirely necc: Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='Z:'") ' server share, total disk s...

How do I 'wait' for a certain dialogue in a Word document macro?

I’ve got a macro that does a search/replace in a selection but at the end of the task it shows the 'Do you want to search the remainder of the document' dialogue and I never want it to search the remainder so I’d like to have it click ‘n’ and then continue with the rest of the doc. In is there a way to do this? ...

VBS Script - Run series of .batch jobs

Help me run a series of .bat script they are located like so: p:\Co-Brand\export.bat p:\Generic\export.bat p:\Tri-Brand\export.bat Thanks in advance, Best regards, Joe ...

How can you tell if a user choose not to install a plug in?

Hi all, I am not sure the user is going to install the plug in. They can choose not to install. I need to know information like, install complete, or the user choose not to install. Any ideas? Thanks, Grae ...

VBScript - Unable to trap IE Settings - Security - Trusted Sites in Windows Registry

Hi, I'm trying to trap the registry keys for the following IE settings. Here's how you get there, a. Open IE and navigate to Internet Options - Settings - Trusted Sites b. Click button - "Custom Level" c. In window - "Security Settings - Trusted Site Zones", I'm trying to update the checkboxes (i.e. set to "Enable") 1. Binary and scri...

get result from a vbscript in c#

hey everyone. i am trying to create a program that runs ti-84 programs. i just need to know how to get the results from a vbscript. if there is anny possible way, please tell me. ...

How to get the string from an address specified by a long in VB

In vba, There is an address held by a long type which points to a null-terminated string, but I can't find a way to get the string from this address: long str_address = ... string str = ? Would you please shed some light on this? ...

How to write a script for organizing my desktop windows? (WinXP)

I would like to write a script that moves the currently open Windows to a certain location. Ideally, my program would look like this: var window = FindWindow("Winamp"); window.setPos(1140, 900, 160, 124); // set x, y, width and height window = FindWindow("Windows Live Messenger"); window.setPos(1140, 0, 900, 124); // etc... I suspe...

Is there a way to extract email address from a Outlook distribution list?

Is there a way to extract email address from an Outlook Distribution list via script? I am looking for a way to extract all the email addresses from a Distribution list and output it to a CSV file. ...

Pass Credentials to WMI Call in VBScript

Hi everyone, I have VBScript inside a HTA getting the ping status from a local WMI call.. I also have a function to get the last reboot time of the remote pc.. Function GetReboot(strComputer) Set objWMIService = GetObject _ ("winmgmts:\\" & strComputer & "\root\cimv2") Set colOperatingSystems = objWMIService.ExecQuery _ ...