Command Line Questions

G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.customize (More info?)

Dear All,
I had 2 questions about using the command line within Windows XP to stream
line support functions. I am trying to write some batch files but have
encountered the following problems, that I was hoping that someone would be
able to help me with:
1 - I'm trying to test through a command line in an if statement if a
computer that I am trying to connect to is on. I thought of using a ping
command and then trying to rip the "Recieved" packet number out of the
output, then if that number is greater than 0 the computer is turned on. But,
here in lies the problem, I'm trying to do that using the FOR /F command but
given that a ping can output up to 8 lines of text, does anyone know how I
could delimit the output by carridge return / line feed to break the output
up into each line, then I can rip the recieved packet value out of the
string. Or is there a simpler way of testing whether a computer is powered on
through the command line?
2- My second question was is there a command line switch for Computer
management (%SystemRoot%\system32\compmgmt.msc) that I could use to connect
automatically to a remote network computer? It seems like a simple thing to
do, but I haven't been able to find any directions either on Microsoft.com or
Google.
Thank you for your learned advice in advance.
Sam Horwood
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.customize (More info?)

For the first, you could use IFEXIST and look for a network share on the remote computer. I "think" IFEXIST is supported in BAT files. If not, it certainly is in VB Scripts.

And there are no command line options for COMPMGMT.MSC that I'm aware of.

--
Doug Knox, MS-MVP Windows Media Center\Windows Powered Smart Display
Win 95/98/Me/XP Tweaks and Fixes
http://www.dougknox.com
--------------------------------
Per user Group Policy Restrictions for XP Home and XP Pro
http://www.dougknox.com/xp/utils/xp_securityconsole.htm
--------------------------------
Please reply only to the newsgroup so all may benefit.
Unsolicited e-mail is not answered.

"Sam Horwood" <Sam Horwood@discussions.microsoft.com> wrote in message news:38955600-D48C-45DB-AF09-69FA1DAE67D0@microsoft.com...
> Dear All,
> I had 2 questions about using the command line within Windows XP to stream
> line support functions. I am trying to write some batch files but have
> encountered the following problems, that I was hoping that someone would be
> able to help me with:
> 1 - I'm trying to test through a command line in an if statement if a
> computer that I am trying to connect to is on. I thought of using a ping
> command and then trying to rip the "Recieved" packet number out of the
> output, then if that number is greater than 0 the computer is turned on. But,
> here in lies the problem, I'm trying to do that using the FOR /F command but
> given that a ping can output up to 8 lines of text, does anyone know how I
> could delimit the output by carridge return / line feed to break the output
> up into each line, then I can rip the recieved packet value out of the
> string. Or is there a simpler way of testing whether a computer is powered on
> through the command line?
> 2- My second question was is there a command line switch for Computer
> management (%SystemRoot%\system32\compmgmt.msc) that I could use to connect
> automatically to a remote network computer? It seems like a simple thing to
> do, but I haven't been able to find any directions either on Microsoft.com or
> Google.
> Thank you for your learned advice in advance.
> Sam Horwood