Textpad in command prompt

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
edtheuniquegeek
Posts: 5
Joined: Mon May 03, 2010 8:23 pm

Textpad in command prompt

Post 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
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post 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.
Hope this was helpful.............good luck,
Bob
edtheuniquegeek
Posts: 5
Joined: Mon May 03, 2010 8:23 pm

Post 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.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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.
edtheuniquegeek
Posts: 5
Joined: Mon May 03, 2010 8:23 pm

Post by edtheuniquegeek »

Awesome. That worked. Thanks.
I'm making note of it this time.
User avatar
talleyrand
Posts: 624
Joined: Mon Jul 21, 2003 6:56 pm
Location: Kansas City, MO, USA
Contact:

Post 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
I choose to fight with a sack of angry cats.
edtheuniquegeek
Posts: 5
Joined: Mon May 03, 2010 8:23 pm

Post 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.
ACRobin
Posts: 134
Joined: Fri Nov 04, 2005 9:51 pm
Location: Northumberland,UK
Contact:

Post 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.
edtheuniquegeek
Posts: 5
Joined: Mon May 03, 2010 8:23 pm

Post 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.
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post 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).
polebridge
Posts: 8
Joined: Thu Jun 03, 2010 12:21 pm
Location: A2, Mi, US

Post 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.
luzagodom
Posts: 1
Joined: Sat Jun 05, 2010 8:45 am

Post 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.
haidivolume
Posts: 1
Joined: Sat Jun 05, 2010 8:51 am

Post by haidivolume »

I liked the temporary solution ben_josephs had posted but I would love to find the permanent solution with environment variables settings.
bensonbarton
Posts: 2
Joined: Mon Aug 02, 2010 10:29 am

Post by bensonbarton »

what you said is really make sense!
www.topons.com get a brand new shopping experience here
Post Reply