Question

Exctracting output from a system varible into a text file or database using pstool

Asked by: phxlanadmin

There was a topic earler about extracting data (IP Address) for a login script. I believe it was answered by W 2K. Here is the situation. My supervisor wants to be able to retrieve information from all of our servers and have it in one location. So I found that psinfo from www.systeminternals.com gives me everything he is asking for. I am currently after the following:
# of processors
speed of processors
physical memory
drives space used
drive space free

I have modified the original script trying to get it to work. I think the problem is in the delim field but not sure how to change it or I could be wrong all together. Here is what I have so far.
@echo off

for /F "tokens=1-6 delims=:. " %%k in ('psinfo ^| find /I "Processors speed"') do set proc=%%k
echo %USERNAME%, %DATE%, %TIME%, %COMPUTERNAME%, %proc%>> "C:\sp.txt"

I am getting the all the information except the proc varible.
If anyone uses or knows of something else that will achieve the same information let me know.
Thanks  Trammel

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-04-06 at 09:12:40ID20945337
Tags

psinfo

,

output

Topic

Windows 2000 Operating System

Participating Experts
3
Points
250
Comments
17

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Global Varibles
    If i want a global varible to go throughout all my forms that can be modified by any form how do i create the varible and how do i use it?
  2. Varibles in Delphi
    Hellofrom java i have started learning delphi. In java i use varibles like this : t = Text.getText(); so then i could do things like text.setText(t); How do i do this in delphi?
  3. 200 pts! Getting Varible From exe.
    okay here's the question. I just created a Programe called Hello.exe. In the the hello.exe I have a varible called "MSG" that has aready been assign a value. Wat i want to know is how do i creat another exe called Bye.exe that is able to open the hello.exe file to ...
  4. call varible
    How do I pull a varible from a select box? I have this statement: ElseIf Request.Form("seljobview1") = (rsUser.Fields.Item("UserID").Value) Then "seljobview1" is the name of the select box and (rsUser.Fields.Item("UserID").Value) is ...
  5. varible checking
    is there anyway i could tell if a varible is assigned or not.... the varible is HntWnd: THntWnd; which is a runtime created hint-window, so this is HntWnd := THntWnd.Create(...) the prolem is i need to check whether the window has already been created or not...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: oBdAPosted on 2004-04-06 at 09:23:25ID: 10767333

Try this:

@echo off
for /f "tokens=2* delims=:. " %%a in ('psinfo ^| find /i "Processor speed"') do set proc=%%b
echo %USERNAME%, %DATE%, %TIME%, %COMPUTERNAME%, %proc%>> "C:\sp.txt"

Note that the string to look for is "Processor speed", not "Processors speed".
The "tokens" definition means that the for command should extract the second token and put it into %%a (which will be ignored), all subsequent tokens (*) should be put into %%b.

 

by: phxlanadminPosted on 2004-04-06 at 10:57:36ID: 10768260

That worked, excelent. I actualy had it typed right before except I can't get the variable for the number of processors. I am also trying to to retrieve information when I run it with the /d (which is drive space). This one is pretty confusing, I am trying different token varibles. Here is what I have so far after some editing.

@echo off

for /F "tokens=2* delims=:. " %%a in ('psinfo ^| find /I "Processor speed"') do set proc=%%b
for /F "tokens=2* delims=:. " %%c in ('psinfo ^| find /I "Physical memory"') do set mem=%%d
for /F "tokens=1* delims=:. " %%e in ('psinfo /d ^| find /I "c:"') do set dspace=%%f
echo %DATE%, %COMPUTERNAME%, %proc%, %mem%, %dpace%>> "C:\sp.txt"

still tinkering with the delim values.

 

by: oBdAPosted on 2004-04-06 at 12:14:13ID: 10768878

Use this:

@echo off
setlocal
for /f "tokens=2*" %%a in ('psinfo ^| find /I "Processor speed"') do set proc=%%b
for /f "tokens=2*" %%a in ('psinfo ^| find /I "Physical memory"') do set mem=%%b
for /f "tokens=5-8" %%a in ('psinfo /d ^| find /I "C:"') do (
  set dspace=%%a %%b
  set fspace=%%c %%d
)
echo %DATE%, %COMPUTERNAME%, %proc%, %mem%, %dspace% ^(%fspace% free^)

In this output, you actually don't even need to redefine the delims value. You can use the same for variable in all three commands as well, they're local to the for command. For more information about the different uses of the "for" command, enter "help for" in a command window.

 

by: phxlanadminPosted on 2004-04-06 at 15:05:29ID: 10770200

oBdA
Thank you very much for your fast and accurate response. I wish I knew this scripting as good as you do. I'm thinking of what class @ my community college would give me a good start? Any suggestions? Here is my final script that I have and am thought I would ask one last thing. If you so choose to do it, then great. If it's to much don't worry about it ....Please do it :) LOL

@echo off
setlocal
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Processor speed"') do set proc=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Physical memory"') do set mem=%%b
for /f "tokens=4-8" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo /d ^| find /I "C:"') do (
  set dspace=C: %%a %%b
  set fspace=%%c %%d available, %%e
)
echo %DATE%, %COMPUTERNAME%, %proc%, %mem%, %dspace%, %fspace% free>> "\\vo-phx-fs02\security$\serinf.txt

I entered the C: because the I need the output to identify the drive that it is referring to. Here is what the output looks like:
Tue 04/06/2004, PHX-ADM-007530, 1.0 GHz, 512 MB, C: 55.9 GB, 36.7 GB available, 66% free

The question is are servers have more then one fixed drive. So we were wondering is there a way to pull all the fixed drive information from that machine using the same output format.

 

by: K_2KPosted on 2004-04-06 at 18:51:34ID: 10771325

give us the full output of
   psinfo /d
and i'm sure we can work something out.
if not so short on time i'd download it and check it, i know it's free.

Something like this:
Tue 04/06/2004, PHX-ADM-007530, 1.0 GHz, 512 MB
      C: 55.9 GB, 36.7 GB available, 66% free
      D: 55.9 GB, 36.7 GB available, 66% free
      E: 55.9 GB, 36.7 GB available, 66% free


MIGHT come from something like this:  (you would have to make sure the string searched does not match wrong lines, does match drives info lines and fields pulled included the drive letter)
@echo off
setlocal
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Processor speed"') do set proc=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Physical memory"') do set mem=%%b
echo %DATE%, %COMPUTERNAME%, %proc%, %mem%>> "\\vo-phx-fs02\security$\serinf.txt
for /f "tokens=4-8,3" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo /d ^| find /I "Physical drive"') do (
  echo.    %%f %%a %%b, %%c %%d available, %%e free>> "\\vo-phx-fs02\security$\serinf.txt
)


Good Luck,
2K
(\o/)

 

by: oBdAPosted on 2004-04-07 at 00:55:12ID: 10772637

Just noted that there can be of course drives without label, which messes up the number of tokens and makes the (IMHO) ugly direct string manipulation necessary.
For more information about the "call: process" construction (sort of a subroutine in a batch script), enter "help call".

@echo off
setlocal
set dspace=
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Processor speed"') do set proc=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Physical memory"') do set mem=%%b
for /f "delims=" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo /d ^| find /I ": Fixed"') do call :process %%a
set dspace=%dspace:~2%
echo %DATE%, %COMPUTERNAME%, %proc%, %mem%, %dspace%
goto :leave

:process
set line=%*
set letter=%line:~0,2%
set line=%line:~47%
for /f "tokens=1-5" %%a in ("%line%") do set dspace=%dspace%, %letter% [%%a %%b, %%c %%d avail, %%e%% free]
goto :eof

:leave

For some good batch examples, check out for example http://www.robvanderwoude.com/

 

by: phxlanadminPosted on 2004-04-07 at 06:50:07ID: 10774804

oBdA, I copied your script and added the >> command and ran it on my exchange server. All the volumes have labels. This is what I got back:
Wed 04/07/2004, VO-PHX-EX01, 1.7 GHz, 3776 MB, C: [16.9 GB, 7.1 GB avail, 42% free], D: [9.8 GB, 9.4 GB avail, 96% free], E: [332.0 GB, 312.2 GB avail, 94% free]

It's beatiful! Should I expect a problem if the volume doesn't have a label? If so I can just make sure that the volumes do have labels.

 

by: phxlanadminPosted on 2004-04-07 at 08:09:04ID: 10775486

My Final Script::::::
@echo off
setlocal
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "kernel version"') do set kern=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "service pack"') do set sp=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "processors"') do set np=%%a
set dspace=
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "service pack"') do set sp=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "processors"') do set np=%%a
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Processor speed"') do set proc=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "Physical memory"') do set mem=%%b
for /f "delims=" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo /d ^| find /I ": Fixed"') do call :process %%a
set dspace=%dspace:~2%
echo %DATE%, %COMPUTERNAME%, %kern%, %sp%, %np%, %proc%, %mem%, %dspace%>> "\\vo-phx-fs02\security$\systemspec.txt"
goto :leave

:process
set line=%*
set letter=%line:~0,2%
set line=%line:~47%
for /f "tokens=1-5" %%a in ("%line%") do set dspace=%dspace%, %letter% [%%a %%b, %%c %%d avail, %%e%% free]
goto :eof

:leave


I use Hyena with a command that runs psexec which will run this batch file on remote machines. All I have to do is select the machines I want in Hyena and run it. It works AWSOME!!! (note: NT4 doesn't come out with date echo or the drive letter but who cares) I did go through and label all of my server volumes. You guys are the greatest.

 

by: phxlanadminPosted on 2004-04-07 at 08:14:45ID: 10775529

I moved these two lines back up above the set dspace.
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "service pack"') do set sp=%%b
for /f "tokens=2*" %%a in ('\\vo-phx-fs05\Scripts\HyenaTools\Pstools\psinfo ^| find /I "processors"') do set np=%%a


ps, how do I edit a post, I can't find it on here.

Trammel

 

by: phxlanadminPosted on 2004-04-13 at 10:09:53ID: 10815451

I have had this batch file running in the GPO policies for over a week now. It seems that every few days my log file is being over written. The data started out with data from April 6, then a few days later I only have data back from the 8 and today it only has data back from the 12th. I am thinking that some systems may not see the log.txt and there for just writes a new fiile. Which in turn over writes the file. I have set the advanced ntfs permissions so that the delete is unchecked. But that was when I had data on the 8th. Anyone have any ideas what or why my data is being over written?

Trammel

 

by: oBdAPosted on 2004-04-13 at 10:27:42ID: 10815586

I can't say that I have an idea. Anything special about the very first entry in the "new" log (the line itself, the machine OS, something else that's different from the rest)?

 

by: phxlanadminPosted on 2004-04-13 at 10:38:30ID: 10815674

I looked at the first entry on the file and the first line has been three different machines (with the last three files that have emerged). The data is the same as the rest as far as out put goes. Is there a way to put a wait command before the append. Im trying to figure out how I can debug this somehow. The log looks great with the information that it gathers (thanks again).

 

by: oBdAPosted on 2004-04-13 at 10:56:37ID: 10815834

In this case, this shouldn't make a difference, but you can try to replace the "echo" line with this:
>>"\\vo-phx-fs02\security$\systemspec.txt" echo %DATE%, %COMPUTERNAME%, %kern%, %sp%, %np%, %proc%, %mem%, %dspace%

There are several possibilities for pausing:
If you have the Resource Kit, put sleep.exe in a share and call it with the number of seconds to wait:
\\SomeServer\SomeShare\sleep.exe <SecondsToWait>

Or you can misuse ping:
ping -n 1 -w <SecondsToWait*1000> <Unreachable IP>
(for this to work, the IP address you ping has to be unreachable!)

If you want to wait for a key, you can use
pause

 

by: jzanettePosted on 2004-04-16 at 03:41:58ID: 10840898

If you'd like to try it without any third party utilities, and with code that will run CONSISTENTLY across ALL NT-based operating systems from NT4SP6A+ through Server 2003, you might be interested in the following one-line command:

(((%.GetLogDate%)&(%.GetLogTime%))%.Silent%) & (FOR /F %A IN ('%.eNetView%') DO @ (FOR %B IN (%#UPPER:~4%) DO @(%.Kity%  ( (PUSHD \\%A\%B$) && (%.GetFreeM% %.Silent% & CALL ECHO ^%#LogDate^%,^%#LogTime^%,%A,%B,^%#FreeM^% & POPD) ) ) ) )

The above command provides a date and time coded Free Space Report for all local drives on all machines that display in the output of "Net View".  It is assumed that you have access to the administrative shares (C$, D$, etc.).

The command interpreter processes this as one line of code, so it's usually quite fast.  In extremely large networks, the code is easily modified to use a temporary file for storing the machine names.  To use it in a script, change the following items:
%A                        becomes          %%A
%B                        becomes          %%B
^%#LogDate^%     becomes         ^%%#LogDate^%%
^%#LogTime^%    becomes         ^%%#LogTime^%%
^%#FreeM^%       becomes         ^%%#FreeM^%%

*******

The output of this command is a comma separated list that looks like this:

20040416,052826,SERVER1,C,1067
20040416,052826,SERVER1,D,3754
20040416,052826,WORKSTATION1,C,801
20040416,052826,WORKSTATION1,D,1234
20040416,052826,WORKSTATION1,L,5468
20040416,052826,WORKSTATION1,R,0
.
.
.
etc.


The format is YYYYMMDD,HHMNSS,Computername,Drive,FreeSpaceInMillionsOfBytes

*******

How does this work?

.GetLogDate and .GetLogTime retrieve YYYYMMDD and HHMNSS and save these values in variables named #LogDate and #LogTime.  The .Silent command suppresses the display of YYYYMMDD and HHMNSS to the console.

The outer loop (FOR /F %A) sends the output of the command .eNetView (a formatted list of all systems displayed by the "Net View" command) to the inner loop (FOR /F %B).  The inner loop processes a space-delimited list of drive letters from C through Z and tries to execute a PUSHD command to the administrative share associated with that drive letter on each system (\\ComputerName\C$, \\ComputerName\D$, etc.)

The .Kity command (KITY stands for Keep-It-To-Yourself) suppresses any errors from PUSHD when it does not find, or cannot access, any of the administrative shares.

If PUSHD is successful, commands after the "&&" are executed for the machine represented by %A and the drive letter represented by %B.

The command .GetFreeM retrieves the free space, in whole millions of bytes, that is available on the subject drive and saves this value in variable #FreeM.  Again, we use %.Silent% to suppress the console display of the free space value.

The CALL ECHO command displays the final output while dynamically expanding the contents of #LogDate, #LogTime and #FreeM.

Finally POPD returns us to the original directory (only if PUSHD was successful).

*******

The resources used above are present on EVERY installation of Windows NT-based systems without adding any additional software to the base OS.  Reference pages follow.

#Constants

    #UPPER (http://TheSystemGuard.com/NTCmdLib/Constants)

.Mount/\Commands

    .Silent (http://TheSystemGuard.com/MtCmds/RedirRapids)
    .Kity (http://TheSystemGuard.com/MtCmds/RedirRapids)

   .GetFreeM (http://TheSystemGuard.com/MtCmds/GetValue/GetFreeM.htm)
   .GetLogDate (http://TheSystemGuard.com/MtCmds/GetValue/GetLogDate.htm)
   .GetLogTime (http://TheSystemGuard.com/MtCmds/GetValue/GetLogTime.htm)

   .eNetView (http://TheSystemGuard.com/MtCmds/NetValue)

Common Command Set - Internal

   CALL (http://TheSystemGuard.com/TheGuardBook/CCS-Int/CALL.htm)
   ECHO (http://TheSystemGuard.com/TheGuardBook/CCS-Int/ECHO.htm)
   FOR (http://TheSystemGuard.com/TheGuardBook/CCS-Int/FOR.htm)
   POPD (http://TheSystemGuard.com/TheGuardBook/CCS-Int/POPD.htm)
   PUSHD (http://TheSystemGuard.com/TheGuardBook/CCS-Int/PUSHD.htm)
   SET (http://TheSystemGuard.com/TheGuardBook/CCS-Int/SET.htm)

!GuardNote about calculating various values using SET /A commands

   (http://TheSystemGuard.com/TheGuardBook/CCS-Int/SET.htm#MaxValuesForSet/A)

*******

Much of the info mentioned in previous comments is also available without third party tools.  For example the :System_Info procedure returns the current ServicePack, installed HotFixes and the IE Version, if installed.  A list of installed applications (same as the list in Control Panel, Add/Remove Programs) is also made available.

   :System_Info (http://TheSystemGuard.com/NTCmdLib/Procedures/SI.htm)

Finally, ".Wait" is a non-CPU intensive timed pause command.

   .Wait (http://TheSystemGuard.com/MtCmds/CrystalClear/Wait.htm)

*******

The main advantage of putting this in a one-liner is that you can now create your own Mount/\Command called, for example, ".ReportFreeSpace".  All you have to do is store the code in an environment variable under a name that makes sense to you.

In your actual script, you use one self-documenting command:

   %.ReportFreeSpace%

and the entire report is generated.

Further explanation and a color-coded example can be provided upon request.  For a list of all the commands and resources available, see (http://TheSystemGuard.com/default.asp#MasterCommandList).

 

by: K_2KPosted on 2004-04-17 at 13:01:15ID: 10850675

After trying a few of these on my XP box with no luck, I checked some of the documentation from thesystemguard.

These are all available ONLY if you have installed the third-party Command Library that attaches itself internally and partially externally to the MS command interpreter.

This is available at  http://thesystemguard.com/NTCmdLib.asp and function very similar to www.systeminternals.com utilities.  The mount commands from thesystemguard helps you mount your commands as listed above by placing a "hook" into cmd.exe through which variable substitution is redirected.  Most stuff from system internals is less intrusive to the MS Operating Systems and hence does not try to "hide" OS differenes as deeply as mount commands.  Mount commands are available "as low as $2 per computer"

The notices pasted on most  thesystemguard.com pages are carefully worded to state "no OTHER third party" software need be added for various versions of NT past the earliest supported service pack.  It does NOT state ( unless on pages I did not see ) that itself is not a third party add-on.  Indeed it is one even if it does state otherwise somewhere, so i doubt that they make that claim.  
Being a third party add-on is not a bad thing, if you can talk your local IT security team into evaluating it, and if it fills your needs.


(\o/)  Hope This Helps,
2K

 

by: jzanettePosted on 2004-04-18 at 01:45:49ID: 10852414

A color coded example of the code posted in my previous comment can be viewed as Example 2 on the GetFreeM Page at (http://TheSystemGuard.com/MtCmds/GetValue/GetFreeM.htm).

*******

Some clarifications:

Command Libraries are implemented as shell scripts.  There is no binary code, only scripting commands.  There is no installation necessary as all resources are contained within a single file (NTCmdLib.cmd).  There are no hooks or attachements into cmd.exe, and NOTHING WHATSOEVER is modified on the host system.  The library does not even have to be on the local disk but can be called from, for example, the same directory as the system login script.

To use the library, you "Initialize" it by typing "NTCmdLib /Init".  The initialization process involves checking various system parameters (using only the builtin scripting commands COMMON to all four platforms - NT, 2K, XP and K3) and then preloading about 50K of highly compressed and optimized scripting code into the local environment.  The actual code that gets placed in the environment is extremely session-specific for THIS COMPUTER at THIS TIME.  This code is available for immediate use, using a "sounds like what it does" syntax, without having to access the hard disk.  These "Mounted Commands" behave and perform like other "internal commands" such as FOR, IF, and SET.

The Initialization process smooths out the the various OS-specific and configuration-specific "bumps".  You can use the same script for all of your machines and write code like:

   %.ifServer% (
      [skip workstation updates]
   ) ELSE (
     [install workstation updates]
   )

*******

The reason they are presented as NOT "third-party" is because a typical usage is on a system where it is OK for someone to write their own shell script, but it is not OK to install (or even run) a third party executable.  This leads to many frustrated SysAdmins asking questions like "How do I write a script to do <insert-problem-description-here> using only the builtin commands?!"  Once the problem is solved and briefly tested, the code is put in production, and we're on to put out the next fire.  Until something goes wrong and we have to go back and look at the code again....

Unless you work with batch files often ( and even if you do), it's easy to forget what the code you wrote last month does.  Especially if you cut and pasted it from somewhere on the Internet.  How many times have you spent many fuming hours trying to get a percent sign to stand on it's head at just the right angle?!

So, when a script contains

   %.Silent% COPY Source Destination

instead of

   COPY Source Destination >NUL 2>&1

it is much easier to maintain, even for the part-time System Admin who is responsible for the office network but their real job (the one that demands the majority of their attention) is something else (like Office Manager, Accountant, Engineer, etc.).

*******

For a step by step example of how a MountCommand is constructed, read the sample issues of our KnowledgeLetter at (http://BoomingOrFuming.com).

And finally, there *IS* a FREE Advanced Command Library (ntlib.cmd) available at (http://ntlib.com).  It includes all the commands in the previous example except .GetFreeM and .eNetView.  There are other commands included in the Advanced Library such as ".GetFree" and ".NetView", that could be used to create a similar, but not identical, solution.

*******

To Mr. 2K:

Thanks for taking the time to look at the site.  Why don't you give the Command Library a trial run and see for yourself the benefits I've described?!

 

by: phxlanadminPosted on 2004-04-21 at 15:08:23ID: 10883414

I will stick with the PSTools because it's free and it works for now. I looked at this command line and they say as low as $2.00 per machine.
 The only issue with this script that doesn't work is that the DC's won't let me run it against them. Guess thats what I get for not being a Domain Admin.
 Let me through this out and see what you guy's know or think. How about a program or script that I can put on my servers so they would run a daily or weekly schedule. That would output a html format of it's basic information. CPU, memory and drives usage & free space. Just a????????

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...