There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
antivirus audio avg avg 8 bios boot browser bsod computer cpu crash css desktop driver dvd email error excel explorer firefox firefox 3 freeze game graphics hard drive hardware help please hijackthis hjt hjt log install internet internet explorer itunes javascript lan laptop malware missing monitor msn network networking openoffice outlook outlook 2003 outlook express php popups problem router security seo slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless word
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Tricky command line thingy, can I have some help?


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
Jawah's Avatar
Junior Member with 3 posts.
 
Join Date: Apr 2008
04-Apr-2008, 03:20 PM #1
Question Tricky command line thingy, can I have some help?
Hello!

OK, I'm left with a slight problem. I just can't do this whole command line business!

What I'm making is a toolbar for someone, for their web browser. Everything works and I've got a software package to make the main part of the toolbar for me.

But I need a button that can launch his BitTorrent client program.

The software package only allows you to, when trying to open an exe, specify two things: 1) The Exe name, and 2) any parametres to go with it.

The problem is that I don't know which BitTorrent client he's got. So I know that I can fathom it out like this:

1) Set the exe name as "cmd.exe" to open up the command line...

2) Put this is as the parametre values:

Code:
/k ftype BitTorrent
By putting that in, it pops up the Command Line and shows that BitTorrent files are associated with the program (in my case, my download manager, FlashGet - so for me it says "BitTorrent = "C:\Program Files\FlashGet\FlashGet.exe" "%1".

The problem I'm facing is how to get the computer to fathom out what his BitTorrent client is (solved), BUT THEN launch it, all in one Parameter line!

If anyone could tell me how to do this, then I'd be very appreciative

Thank you!

EDIT: I know you say don't post about BitTorrent, etc... but, this doesn't really involve USING BitTorrent or whatever... it'd be just the same if it was Microsoft Word... ? Sorry, delete this if you have to...
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,537 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
04-Apr-2008, 09:27 PM #2
Code:
/k for /f "tokens=1,* delims==" %I in ('ftype bittorrent') do start %~dpnJ.exe
Note: This will only work if the file type bittorrent is associated with his client; not all clients set up that association.
Also, the path returned must not contain a variable.
For example ftype txtfile gives txtfile=%SystemRoot%\system32\NOTEPAD.EXE %1
the start command then becomes start c:\%SystemRoot%\system32\NOTEPAD.exe
%SystemRoot% doesn't get expanded, and if it did, the drive letter would not be needed.
You can do one path format or the other, but I haven't gotten it to work reliably with both types.
If you can start a batch file instead of an exe file, this can be checked easily.

Jerry
__________________
Of course I know all the answers ; I just don't always match the answers to the right questions

Warning -- Windows spoken here. (Rated R for Strong Language and Violence -- When your Windows PC flies through a window, that's violent, right?)
Jawah's Avatar
Junior Member with 3 posts.
 
Join Date: Apr 2008
05-Apr-2008, 04:36 AM #3
Working... well, sort of...

It's very close, just a little bit of an error now. When running cmd.exe with the parameters you specified, the command line window pops this up:

"Windows cannot find 'C:\Program'. Make sure the name you typed blah blah blah"...

As you say, I would do it in a batch file but the way the toolbar software works limits you from doing this...

The final output on the DOS screen is this (after clicking OK on the cannot find dialog)...

Code:
C:\PROGRA~1\SOFTOM~1\TOOLBA~1\projects\cab.in.work>start C:\Program Files\FlashGet\FlashGet.exe
The system cannot find the file C:\Program.

C:\PROGRA~1\SOFTOM~1\TOOLBA~1\projects\cab.in.work>
Thanks for the help so far though...
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,537 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
05-Apr-2008, 04:50 AM #4
Dang, hate when I forget the durned quotes. Seems I always pick folders without spaces so I never notice. Try this:
Code:
/k for /f "tokens=1,* delims==" %I in ('ftype bittorrent') do start "%~dpnJ.exe"


Jerry
Jawah's Avatar
Junior Member with 3 posts.
 
Join Date: Apr 2008
05-Apr-2008, 07:39 AM #5
Almost there...

What happens now:

Two windows open - the first window:

First window titled "C:\WINDOWS\system32\cmd.exe"
Contents of window (same as last time but without the error):
Code:
C:\PROGRA~1\SOFTOM~1\TOOLBA~1\projects\cab.in.work>start C:\Program Files\FlashGet\FlashGet.exe

C:\PROGRA~1\SOFTOM~1\TOOLBA~1\projects\cab.in.work>
Then there's a second window, titled "C:\Program Files\FlashGet\FlashGet.exe"
Contents of window:
Code:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\PROGRA~1\SOFTOM~1\TOOLBA~1\projects\cab.in.work>
And then, no program actually opens...

Sorry this is dragging on a bit longer than I guess it should...
TheOutcaste's Avatar
Computer Specs
Senior Member with 1,537 posts.
 
Join Date: Aug 2007
Location: Oregon, USA
Experience: Intermediate
08-Apr-2008, 06:08 AM #6
Check the shortcut that starts the program. Perhaps there is a command line switch that needs to be specified.
If you open a command prompt, can you start the program by entering:
start C:\Program Files\FlashGet\FlashGet.exe
or just
C:\Program Files\FlashGet\FlashGet.exe
If neither work, try first switching to the program folder
cd C:\Program Files\FlashGet
and see if it will start then. Could be the program is looking for it's configuration file in the current folder which it expects to be C:\Program Files\FlashGet, but the current folder is actually C:\PROGRA~1\SOFTOM~1\TOOLBA~1\projects\cab.in.work

Jerry
__________________
Of course I know all the answers ; I just don't always match the answers to the right questions

Warning -- Windows spoken here. (Rated R for Strong Language and Violence -- When your Windows PC flies through a window, that's violent, right?)
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:48 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.