Script variable trimming
Posted on May 8th, 2009
Suppose you are trying to run some scripts based on a command line variable, but the variable being passed to it is surrounded by quote marks.
i.e. “device_name” when all i want is device_name
There is an easy way to trim this. In the script need to set this passed variable to a seperate variable, and then trim it byt doing the following:
SET tempvariable=%1 (need to set %%1 if its run as a script file)
echo %1 (will show “device_name”)
echo %tempvariable% (will show “device_name”)
echo %tempvariable:~1,-1% (will show device_name)
The trimmed variable can then be used for another task, i.e. to start a service on a remote server
sc \\%tempvariable:~1,-1% start “ServiceName”
Happy trimming!
Tags: ", %1, clean, cmd, device_name, edgesight, remove, sc, script, set, trimming, variable
Filed under Scripts/Reg | 1 Comment »
Types of memory usage
Posted on April 3rd, 2009
When running edgesight reports or looking into server memory usage, the following types of memory are listed:
- Virtual
- Private
- Working set
In looking into a particular issue, I wanted to determine exactly what these different types are and this is what I found.
Virtual
Virtual Bytes is the total size of the non-free pages in a process’ virtual address space. This includes private, image and mapped pages (reserverd and committed pages).
Private
Private Bytes is the total size of the private pages that are not shared.
Working set
The working set of a program is a collection of those pages in its virtual address space that have been recently referenced. It includes both shared and private data. The shared data includes pages that contain all instructions your application executes, including those in your DLLs and the system DLLs. As the working set size increases, memory demand increases.
This is the overall ‘memory usage‘ figure.
Useful links
- sysinternals
- Crayon Metaphor
- msdn (working set description)
- msdn (forum)
- Google groups
Tags: committed, description, edgesight, memory, private, virtual, working set
Filed under Windows 2003 | No Comments »
