Go Back   The Palace Avatar Chat Community Forums. > Palace Builders Palace Users > Scripting Help

Scripting Help Iptscrae et omni potentum, Scripting is all powerfull. So here you can ask for Help with your scripting problems.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-03-2008, 09:31 PM
Palace User
 
Join Date: Apr 2008
Posts: 1
Rep Power: 0
mth5765 is on a distinguished road
Assistance with a script please

I have a script that's purpose is to list the services running on multiple servers from a text file. The problem I am having is when I try to run the script I get the following error:
"C:\WINDOWS\system32\ListServices.vbs(1,32)
Microsoft VBScript compilation error: Expected end of statement: cscript ListServices.vbs.Const INPUT_FILE_NAME="C:\Scripts\Computers.txt"

I am not sure what it is looking for, apparently the offending item is character 32 which appears to be a space, I am not sure. I have googled and searched and can't find anything to see to help me so this is my last resort. The script is below:

cscript ListServices.vbs.Const INPUT_FILE_NAME="C:\Scripts\Computers.txt" Const FOR_READING = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(INPUT_FILE_NAME, FOR_READING)
strComputers = objFile.ReadAll
objFile.Close
arrComputers = Split(strComputers, vbCrLf)
For Each strComputer In arrComputers
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colRunningServices
Wscript.Echo objService.DisplayName & vbTab & objService.State
Next
Next

Please let me know if you need any further information and I also appreciate any assistance with this in advance.

Thank You,
Micah
Reply With Quote
Reply
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


The Latest Posts
Title, Username, & Date Last Post Forum
download
03-21-2011 11:20 AM
by maarten
User Questions
Palace for Mac OS 10.6?
03-13-2011 09:39 AM
by pawnipt
User Questions
Server
03-07-2011 04:52 PM
by satinrose
User Questions
Return room Script
02-24-2011 12:07 AM
by jaela
Room Scripts
Releasing source code
02-17-2011 09:19 AM
by Sman™
Developers Forum
Website spammers
01-26-2011 08:48 PM
by maarten
The Planet: Palace News
Online Users: 67
1 members and 66 guests
VeraFlorsewal
Most users ever online was 1,010, 06-27-2007 at 11:45 PM.
Stats
Members: 5,112
Threads: 1,141
Posts: 4,004
Top Poster: maarten (1,169)
Welcome to our newest member, cliffymayers


All times are GMT +2. The time now is 03:04 PM.


Powered by vBulletin
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0