Questions tagged [vbscript]

VBScript is a general-purpose scripting language developed by Microsoft that is modeled on Visual Basic. It is commonly used for Windows system administration. Some applications may use it as an internal scripting language allowing application automation.

217 questions
1
vote
1 answer

Delete folders with exclusions (case)

i found a VB script that uses FileSystemObject to delete every folder on a drive except ones i specify, my problem is that the FileSystemObject cannot see or enumerate folder with trailing / leading - period / space, but DIR command can, I trying to…
1
vote
1 answer

Set default printer by vbscript on Server 2008 R2 RDS

I'm trying to get the Task Scheduler to run a vbscript that sets default printers for individual users on a Server 2008 R2 RDS machine. Unfortunately my only success so far is getting any logon to trigger the script for my own user. Does anyone know…
CokaKola99
  • 23
  • 1
  • 5
1
vote
2 answers

Using IIS6 to run kill process. Executable hangs

I'm using the following code (any tried many variations) in a web page that is supposed to kill a process on the server: Process scriptProc = new Process(); SecureString password = new SecureString(); password.AppendChar('p'); …
David
  • 439
  • 1
  • 5
  • 17
1
vote
2 answers

PSKill does not run from VbScript

We have a site on our local IIS6 Windows 2003 server that occasionally locks up, and we would like a VbScript to kill the process. It is located in the system32 folder. I'm running these tests on the local machine. For simplicity, my VbScript file…
David
  • 439
  • 1
  • 5
  • 17
1
vote
1 answer

LOGON script won't add first share

I have the following problem: When i run my LOGON_SCRIPT.vbs to add network shares to users of a specific group it skips the first one if the user is part of Kleinkunstig_Users (it will not add the first share). But if i add another group it will…
bk207
  • 173
  • 1
  • 2
  • 9
1
vote
2 answers

WMI script to list of memberships of current computer?

I have a AD hosted on 2003R2 and 2008R2, I would like to check the membership for the domain computer (e.g. compA) when an user logs on using that computer (e.g. compA) and perform certain operations inside a script. I think WMI could probably be…
William
  • 163
  • 1
  • 10
1
vote
1 answer

How do I extract the Drive letter from the result of EnumNetworkDrives

I'm using EnumNetworkDrives to list out all the drives on a machine. I'd like to determine which object in the collection is drive "X" What object is returned in EnumNetworkDrives that has a property I can compare to a drive letter?
makerofthings7
  • 8,911
  • 34
  • 121
  • 197
1
vote
2 answers

get account name for IIS anonymous user

I'd like to get the name of the anonymous user account for an IIS install. It's easy enough to assume that it's the machine name, but in the event that the machine name has changed I'd like to still know what it is. Ultimately I'd like to be able to…
nerraga
  • 123
  • 3
1
vote
1 answer

Adding a second VHD to a Hyper-V VM programatically or from the command line

I have been scripting the creation of my Hyper-V VMs with vbscript successfully for sometime now. All the technician has to do is run my script, select the type of server they are building (EG. a Web server, SQL server, etc) and all the appropriate…
Fitzroy
  • 321
  • 2
  • 4
  • 8
1
vote
1 answer

Monitor message queues

I'm looking for a simple way to monitor RabbitMQ queues from SCOM. In particular, I want to be notified when a particular queue (one we use for "dead letters") is not empty. RabbitMQ has a RESTful web API (the RabbitMQ Management HTTP API) that will…
TrueWill
  • 119
  • 1
  • 1
  • 10
1
vote
2 answers

iis vbscript remove all site bindings and replace with list of new bindings

I have a single host with 500+ bindings associated to it, and I would like to first purge this host of all its bindings and replace them from a list of bindings in a file. The format of the fill will be a comma separated list of the bindings to…
Chris Hough
  • 313
  • 2
  • 4
  • 21
1
vote
5 answers

Alternative to WScript.Sleep

I'm using WhatsUpGold to monitor the uptime of services and one of them is a MySql server. Since there's no explicit support for MySql, I'm forced to write a VBS script to do it. Unfortunately, WhatsUpGold doesn't support WScript.Sleep. The…
Richard Nienaber
  • 183
  • 1
  • 2
  • 7
1
vote
2 answers

Need to sort files by extension and distribute to folders with CMD, VBS, BAT

Have a Exec that likes to download the internet. Free files and such. Of course its all mixed and in a download directory. I know that one of the admins before me had a script written but took it with him. Can anyone steer me in the right direction…
mikedopp
  • 229
  • 2
  • 7
  • 16
1
vote
1 answer

Use vbscript to set local user's terminal services startup environment

If I was in AD, the parameters would look like: objUser.ConnectClientDrivesAtLogon = Enabled objUser.ConnectClientPrintersAtLogon = Enabled objUser.DefaultToMainPrinter = Enabled objUser.TerminalServicesInitialProgram =…
SeanFromIT
  • 212
  • 1
  • 5
1
vote
1 answer

How to uninstall Windows Script Host and install WSH 5.7

What I'm trying to achieve is to simply reinstall Windows Script Host. However I can't uninstall WSH and when I try to run the Windows Script Host 5.7 installer I get an error of; Setup has detected that the Service Pack version of this system…
stead1984
  • 577
  • 8
  • 16
  • 32