Page 1 of 1
Textpad in command prompt
Posted: Mon May 03, 2010 8:26 pm
by edtheuniquegeek
I know I have seen how to set this up somewhere but I can't seem to find it.
Could someone tell me how to setup environment variables in Windows to allow me to use Textpad in command prompt to open files?
Thanks in advance
Posted: Tue May 04, 2010 2:01 am
by Bob Hansen
Don't know what environment variables are needed, but if TextPad is installed properly, you can run TextPad from the command line in a Command prompt window. You may need to use the complete path if TextPad folder is not in your path variable.
Search TextPad HELP, search for "Command Line" for the details about the available switches that can be used.
Posted: Tue May 04, 2010 11:48 am
by edtheuniquegeek
Okay. Thanks.
What I am trying to do is enable the setting that when I am in command prompt, instead of typing 'notepad sample.txt' and it opens sample.txt with Notepad or 'write sample.txt' and it opens sample.txt with Wordpad, I want to be able to type 'textpad sample.txt' and it opens it in Textpad.
I had somehow found this environment variable on the internet somewhere (I thought it was on the Textpad website but can't find it now) when my machine was running Windows XP. I have since rebuilt with Windows 7 and completely forgot to take note of that environment variable to enable it in Windows 7 now.
I guess I will need to do some more searching.
Posted: Tue May 04, 2010 12:01 pm
by ben_josephs
The installer should have created a registry entry for it.
If it hasn't, you can add TextPad's program directory to your path. On the command line:
Code: Select all
set path=C:\Program Files\TextPad 5;%path%
(Adjust this to match where TextPad is installed.)
You can set environment variables permanently, but I don't know how to do that in Windows 7.
Posted: Tue May 04, 2010 12:06 pm
by edtheuniquegeek
Awesome. That worked. Thanks.
I'm making note of it this time.
Posted: Tue May 04, 2010 1:56 pm
by talleyrand
ben_josephs wrote:You can set environment variables permanently, but I don't know how to do that in Windows 7.
Windows 7 makes it easier as it has PowerShell installed by default.
Start -> Run
powershell
Code: Select all
$Path = [Environment]::GetEnvironmentVariable("Path", "Machine") + ";C:\Program Files\TextPad 5;"
[Environment]::SetEnvironmentVariable("Path", $Path, "Machine")
Exit
Posted: Wed May 05, 2010 12:56 pm
by edtheuniquegeek
I couldn't get the Powershell code to work.
I liked the temporary solution ben_josephs had posted but I would love to find the permanent solution with environment variables settings.
Posted: Wed May 05, 2010 1:57 pm
by ACRobin
in windows 7 professional go to control panel -> System -> advanced system settings. You will see a button to edit the environment variables.
Not tried it but a place for you to look and try.
Posted: Wed May 05, 2010 2:10 pm
by edtheuniquegeek
Yeah. I know where to make the setting, I just don't know what environment variable configuration to make in order for this to work.
Posted: Wed May 05, 2010 3:54 pm
by ben_josephs
It's in my message above. Find the Path environment variable and stick
C:\Program Files\TextPad 5;
on the front of it (or
;C:\Program Files\TextPad 5
on the end of it).
Posted: Fri Jun 04, 2010 6:32 pm
by polebridge
I don't like to type much, so i have a tp.bat file on my path. The file contains one line:
start "TextPad" "C:\Program Files\TextPad 5\TextPad.exe" %*
so i can type:
tp <some files>
On another machine i AutoRun a profile.bat which contains doskey macros (like unix aliases). One of those is
doskey tp="c:\Program Files\TextPad 4\TextPad.exe" $*
so again i can type:
tp <some files>
I also have a desktop shortcut to TextPad, with a shortcut key defined, so i can hit cntrl-alt-t at anytime to start TextPad.
I havn't done anything with Win7 yet, but i expect these things to work there.
Posted: Sat Jun 05, 2010 9:20 am
by luzagodom
I had somehow found this environment variable on the internet somewhere (I thought it was on the Textpad website but can't find it now) when my machine was running Windows XP. I have since rebuilt with Windows 7 and completely forgot to take note of that environment variable to enable it in Windows 7 now.
I guess I will need to do some more searching.
Posted: Sat Jun 05, 2010 9:33 am
by haidivolume
I liked the temporary solution ben_josephs had posted but I would love to find the permanent solution with environment variables settings.
Posted: Mon Aug 02, 2010 10:34 am
by bensonbarton
what you said is really make sense!