command line paramater printing

  • Thread starter Thread starter surferboy
  • Start date Start date
S

surferboy

i was wondering if there is a way to print out the
command line paramaters of a given file/command and put
them into a text file for later reading? i know that the
command line /? after the file name/command will give the
result printed to screen but i want to have these results
put into a file.
thanks
surferboy
 
An example:

IPCONFIG /? > C:\Temp\IPCONFIG_Parameters.txt

The > character tells the OS to pipe the output to the file indicated.

If you have a USB printer, you may also want to check out this write up

http://www.decompile.com/dataflex/tips/usb_printer.htm

Make careful note of the fact that you have to reference LPT1: with the trailing colon when you print, but not when you create the connection to the printer.
 
thanks again for the help. one problem though, when i
try this with, say the blasterfix patch it doesn't print
the command line paramaters to the file. it creates the
file but doesn't put anything inside of the file. is
there some thing that needs to be done differently?
thanks again for all the help
surferboy
-----Original Message-----
An example:

IPCONFIG /? > C:\Temp\IPCONFIG_Parameters.txt

The > character tells the OS to pipe the output to the file indicated.

If you have a USB printer, you may also want to check out this write up

http://www.decompile.com/dataflex/tips/usb_printer.htm

Make careful note of the fact that you have to reference
LPT1: with the trailing colon when you print, but not
when you create the connection to the printer.
--
Doug Knox, MS-MVP Windows XP/ Windows 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.

"surferboy" <[email protected]> wrote
in message news:[email protected]...
 
If the author of the command got his numbers wrong
then he may have directed the command output to
the error stream. Try this to capture your paramEters:

blasterfix 1>c:\parms1.txt 2>c:\parms2.txt

Which file containts the parameters?
 
If the file is a Windows exectuable, it doesn't work this way, since it sends its output to a windows dialog.
 
this still doensn't output the them to a file it just
puts the to the screen while making empty text documents.
anything else i could try. by the way thanks for all the
suggestions so far.
surferboy
 
isn't there a way around that.
surferboy
-----Original Message-----
If the file is a Windows exectuable, it doesn't work
this way, since it sends its output to a windows dialog.
--
Doug Knox, MS-MVP Windows XP/ Windows 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.

"surferboy" <[email protected]> wrote
in message news:[email protected]...
 
Not that I'm aware of. A Windows executable will, as far as I know, direct its output to a dialog, if it even recognizes the /? switch. Command line executables print them to the console screen, since they don't have dialogs.
 
The /? switch does actualy work and you are right it
prints the results to a seperate window.

here is the whole situation. i am trying to make a
program that will grab the command line paramaters from
ms patches and then create a script that will
automatically install all of them with the correct
command line paramaters. The only problem is how do i
get the command line parameters into my script.
Thanks


-----Original Message-----
Not that I'm aware of. A Windows executable will, as
far as I know, direct its output to a dialog, if it even
recognizes the /? switch. Command line executables print
them to the console screen, since they don't have dialogs.
--
Doug Knox, MS-MVP Windows XP/ Windows 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.

"surferboy" <[email protected]> wrote
in message news:[email protected]...
 
could i use a vbscrit to some how read the text from that
window into a text file?
thanks
surferboy
-----Original Message-----
Not that I'm aware of. A Windows executable will, as
far as I know, direct its output to a dialog, if it even
recognizes the /? switch. Command line executables print
them to the console screen, since they don't have dialogs.
--
Doug Knox, MS-MVP Windows XP/ Windows 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.

"surferboy" <[email protected]> wrote
in message news:[email protected]...
 
surferboy said:
could i use a vbscrit to some how read the text from that
window into a text file?
thanks

Hi

With AutoItX, you can make a "hack", but it is using a SendKey method, and
therefor not trustworthy in all cases ;-)

Here you go:

Set oAutoIt = CreateObject("AutoItX.Control")
Set oShell = CreateObject("WScript.Shell")

' Empy clipboard
oAutoIt.ClipPut ""

' Minimize all windows
oAutoIt.WinMinimizeAll()
WScript.Sleep 2000

oShell.Run "msjavx86.exe /?"

i = 0
Do
WScript.Sleep 1000
oAutoIt.Send "^c"
sText = oAutoIt.ClipGet()
i = i + 1
Loop Until (sText <> "") Or (i > 10)

If sText <> "" Then
oAutoIt.Send "{ENTER}"
MsgBox sText

Else
MsgBox "No text found"
End If


AutoIt/AutoItX is free and can be found here:
http://www.hiddensoft.com/AutoIt/
 
Since its not a window, no. Its a dialog.

As far as how to get your command line parameters into a script, you might find a BAT file easier.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top