I'm not exactly a VB Scripting Wizard, but I can tell you about Central vs. Remote execution.
Central execution means to execute the command / script on the application server. If you are running a script, this assumes your script lives on the application server. You can do stuff like /" which means "launch the command prompt and run this command".
Thank you for clarifying central vs remote execution. I had suspected most of that, but it's good to hear it all put out there like that.
Your last note about putting the "CMD" in the command sounded like it might have been applicable to my situation, so I gave it a go. The "Command / Script" box now has the following typed into it:
Now, when I execute the Extended Object against my machine, I get a new error:
Error occurred during Pagefile.sys Info execution. The system cannot find the specified path.
The /C is not a path. It's a switch. I did a quick search and to execute a vbscript from the command line you need the "cscript" command. You probably want something like this:
"cmd /C cscript c:\blscripts\pagefile_info.vbs"
Usually the message "The system cannot find the specified path." means that your syntax is wrong.
Ok, I'm pretty sure that I've got this issue down to solved for BladeLogic but still working on the VBScript. Here's what I have and the behavior I am now noticing.
In the Extended Object definition page, I ended up putting this exact command in before it would work.
cmd /C cscript c:\blscripts\pagefile_info.vbs (no quotes or it fails!)
Another interesting thing to note is that I have to set it for "Central Execution" or, again, it fails. It fails "Remote Execution" even if I put the same script on the local machines in the same directory. Change the radio button back to "Central Execution" and everything works as it should. The exact error message that I get when I try to run as "Remote Execution" is as follows:
Error occurred during Pagefile.sys Info extended object execution.
I have the information I need to press forward with this project, so no further assistance is required. The information presented here is for future reference and troubleshooting as required. Thank you for your assistance!
hmm - i usually make it like;
cmd /c "cscript c:\foo\something"
local exection will run this only against the appserver, you have to use the remote execution.
I still can't get this script to work under "Remote Execution." I now have the VBScript working as it should, and I can get it to report back like a champ in Local Execution. But, no matter what combination I try under Remote Execution, I get errors.
Under Local Execution, the following will work:
cmd /C cscript c:\blscripts\pagefile_info.vbs //nologo
If I just change it to Remote, it fails. If I put in the quotes as suggested above it fails:
cmd /C "cscript c:\blscripts\pagefile_info.vbs //nologo"
I get the error: "Error occurred during the Pagefile.sys Info extended object execution."
I've tried nearly every combination of quotes, no quotes, unix style directories (/c/blscripts/pagefile_info.vbs), putting nexec in front of it, etc, etc, etc.
What am I missing here?
Full contents of my script are below:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile("C:\pagefile.sys")
CreatedDate = f.DateCreated
LastAccessed = f.DateLastAccessed
LastModified = f.DateLastModified
FileSize = f.Size
returnit = "Created Date: " & CreatedDate & ", Last Accessed: " & LastAccessed & ", Last Modified: " & LastModified & ", Filesize(bytes): " & FileSize
is there anything in the appserver log when you run this?
also, where is the error popping up? (screenshot?)
and look in the agent log of the target system.
do you have the proper permissions on the target system to pagefile.sys ? (who is your role mapping to on the target?)
Has anyone ever got scriptutil to work with a VBScript? I wonder if this is possible.
Have a look at the attached script. It echoes the contents of a VBScript to a temporary file on the remote host, and then calls it via nexec. You won't be able to execute this directly as an Extended Object, but it might give you some ideas for how to go about executing a remote VBScript.
get_vb_property.nsh 801 bytes
i didn't think scriptutil would work against a windows box. i've used the self-extracting nsh scripts that cut themselves up w/ the vbs script in the bottom of the script...
One reason they won't work is because scriptutil requires a certain format at the top of the script using # for comments like so:
# Check the license status of a BladeLogic server agent
and VBScript uses a "'" for comments.
does scriptutil even know what to run on windows?
like you normally name stuff like script.SunOS or script.Linux
what happens for windows ?
I'm guessing it's just not supported. I don't think it was written with Windows in mind.
well, so i renamed one of my sensors to like foo.WindowsNT and then i tried to run it:
blapp% scriptutil -s unowned_files_dirs -h blapp
"C:/tmp/_blapp-2368-0-unowned_files_dirs.WindowsNT" is not a valid Win32 application.
i think windows doesn't know what to do w/ it.
i've tried for a while to get engineering to make scriptutil work w/ batch or vbs...no luck. maybe you can borrow mcmahon's bat.
i think that runcmd might work here...
What was the ultimate resolution to this issue?
I have the exact same problem. I have a VBScript that runs perfectly when I run it directly on my servers but as an Extended Object I get the following error:
Error occurred during MSSQL-Information extended object execution
MSSQL-Information is the name of the extended object and the basic script is "cscript SQLVersion.vbs //nologo". I have tried just about every combination of quotes for my script that you can think of. I have tried using "cmd /C" and "nexec -e". And although the Command / Script should "Remote Execution", I have even tried running it as "Central Execution" but nothing works.