Welcome Guest ( Log In | Register )

Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide.
      
 
Reply to this topicStart new topic
Tricky MS-DOS command line parameter thing..., Any help would be greatly appreciated!
Jack W-H
post Apr 4 2008, 12:56 PM
Post #1


Member
**
Posts: 50
OS: Windows XP Media Center Edition



Hello! Sorry if this is quite an obvious answer... I'm still new to this sort of stuff... smile.gif

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!
Go to the top of the page
 
+Quote Post
TomWij
post Jun 22 2008, 03:03 PM
Post #2


Geek in Training
***
Posts: 124
From: Antwerp
OS: Windovs Vista Ultimate SP1 x64



Why don't you write a batch file that you call?
CODE
/k C:\Batch.Bat BitTorrent

Let that batch file do the ftype and get the "C:\Program Files\FlashGet\FlashGet.exe" out of it, put that in a variable and run the variable.

Use google to learn how to do text processing and how to store things in a variable, etc...
You could also download a win32 version of the linux grep and cut if you know those commands.
Go to the top of the page
 
+Quote Post
Swandog46
post Jun 24 2008, 07:44 AM
Post #3


Malware Expert
Group Icon
Posts: 1,023
OS: Windows XP / Mandrake



QUOTE
ftype BitTorrent

This already won't work if your user has a different distribution -- I use uTorrent and 'ftype BitTorrent' returns nothing on my system.

You want to use 'assoc' to get the association with .torrent files, and then get the command line with ftype.

The right way to do this is by looking up the associations in the registry, but if you are dead-set on using built-in command-line tools only, try this:

CODE
for /f "tokens=2 delims==" %a in ('assoc .torrent') do (for /f "tokens=2 delims==" %b in ('ftype %a') do @echo %b )


Note that if you are going to put this in a batch file you will need to double the %'s.

But this is ugly. Why wouldn't you simply be able to open your .torrent file directly, with whatever you are using to spawn cmd.exe, and let Windows take care of looking up the appropriate associations?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts   2 / 517 15th August 2007 - 04:59 AM
Fllash started - last by Fllash
No New Posts   0 / 106 30th August 2008 - 09:22 AM
dgpro started - last by dgpro
No new   17 / 371 30th October 2008 - 07:56 PM
stversko started - last by __RiP_ChAiN_
No New Posts   0 / 10 Yesterday, 10:20 PM
Sokol started - last by Sokol

RSS Time is now: 22nd November 2008 - 08:58 AM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.