0

I was going through the link Why is my license not showing up? in which Tom has answered the question that he adjusted the script to add wordpad header to the rtf file. I basically want to know how we can achieve this using MS DOS commands in a bat file

Community
  • 1
  • 1

1 Answers1

0

Just open up wordpad, type anything and save the .rtf file. Now open the .rtf file you just created in a plain text viewer like notepad or notepad++. The first couple of lines are the rtf header.

so the batch code to create an rtf file would look like this:

@echo off
setlocal

set "myrtf=C:\rtffile.rtf"

>%myrtf% echo {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
>>%myrtf% echo {\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sa200\sl276\slmult1\lang9\f0\fs22\par
>>%myrtf% echo this is a test\par
>>%myrtf% echo }
Matt Williamson
  • 6,947
  • 1
  • 23
  • 36