Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOS Command Line Parameters For Wordpad/Notepad/Write. 3

Status
Not open for further replies.

jkerman

Programmer
Oct 11, 2002
25
AU
HELP!!
DOS Parameter Experts!!
Anyone know of the (DOS) Command-line parameters for Write or WordPad or Notepad?
HELP!!!.
 
Like if you are just wanting to edit a file it would be

notepad c:\readme.txt


same format for all other microsoft editing applications Richard L. Hankins Jr.
Senior Programmer
Auction Services, Inc.
 
Guess he wants to use it for printing to a Windows printer, not supported from a dos-box/dos-app......s-)

Usually /p is for printing, but I couldn't find much info.

HTH
TonHu
 
Thanks [TonHu] & [RHankinsJr],
Yes, I am trying to directly print to a windows printer using either "WRITE" or "NOTEPAD" or "WORDPAD" and I know I can use either with "/p" [textfilename] to print any textfile, however, I'm trying to find out IF there are any command-line (DOS) parameters that will allow me to change all or any margins to zero (0)?

ie. notepad /p [textfile]
wordpad /p [textfile]
write /p [textfile]

I need to add a paramater or two to change the default margins. left-margin=0 and top margin=0.

ANY IDEA?
ANYONE HAVE ANY IDEAS?
 
Thanks, but no [acerrudo].
That'll only work IF a DOS compatible printer.
Need to print to a windows only printer.
 
jkerman,

Doesn't the 'notepad /p textfile.txt' solution work for you?

HTH
TonHu
 
Dear [TonHu],
Yes notepad/p works But I need to be able to change the default margins to "0" on the DOS Command line.
 
And you tried to set them up correctly in Notepad, closing and trying to /print another file?
You can also reset/clear the pageheadings etc. (Can't test it myself now, time-locked)
HTH
 
You can print to Windows Network printers on Win 2K and XP with copy textfile.txt \\machine\printer. Does that get you any closer to your objective?
 
Thanks [intentdriven],
If only that worked for win98 as well.
Thanks.
 
I think what would solve your problem is to have a way to have the Notepad settings remain after you run the program. That way, you could set the margins and have those margins remain in effect. Here's how to make the Notepad settings "sticky". In Windows 98 or ME run regedit (in Windows 2000 run regedt32) Then navigate to the branch:
HKEY_CURRENT_USER\software\Microsoft. Then select the Notepad folder. In the right pane, double click the word fSaveSettings. In the DWord edit box that appears, change the value from 0(zero) to 1(one). Click OK to save this.
Then open Notepad and set your margins. They should be remembered.
 
Thanks [BillatRma], I'll try it out.
Appreciated.
J.K.
 
There is a program out there on the Web named "AutoIt" that lets you create *.exe's out of its "macro" capabilities for Windows. With AutoIt, I made a little program that sets margins and fonts in Notepad before printing a text file. In my Clipper code, I shell out to the AutoIt .exe and print my file with this "macro" and get perfect settings every time.
 
BillatRma,

This is too cool. Do you know which parameter to set to change the default tab value?

Thanks,

Michael42
 
pbsd,

It would be very ;-) nice if you published your AutoIt script, or some crucial parts of it, in this forum so others can benefit from it.
Just a suggestion...

Thnx,
TonHu
 
Dear [pbsd] (Programmer),
I think you've hit on the best yet.
Appreciated.
I'll look for it.
You wouldn't know of any specific location?
Much Appreciated.
 
Here's the web site for the AutoIt home page:

For Ton Hu - here's the script:
run,notepad.exe %1%
send,!f
send,t
send,{TAB 5}
send,.75{TAB}
send,.75{TAB}
send,{DEL}{TAB}
send,{DEL}
send,{ENTER}
send,!e
send,f
send,courier new{TAB}
send,bold{TAB}
send,10{ENTER}
send,!f
send,p
send,!{F4}
exit

AutoIt is a pretty neat little program!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top