0

I have a program that launches a full screen windows of a video streaming site and automatically logs into the website. This program is design to accept parameters to automatically go a particular channel.

Eg. C:\program.exe 123

This would go to channel 123

One of my friends has an issue where they need to clear the internet cache to allow the autologin to take place so I have a batch file as follows.

@echo off

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 (Deletes Temporary Internet Files Only)

Start program.exe

RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8 (Deletes Temporary Internet Files Only)

Is there anyway that the batch file can be altered to allow me to launch program.bat 123 and for this to be passed on to the program.exe?

2 Answers 2

1

Actually, you can get the parameters sent to the batch file like so:

%1 is the first parameter
%2 is the second parameter

and so on...

So, change it to say:

Start program.exe %1

And that should do it. Or, if I may suggest something, change it to this:

set /p channel=Select a channel: 
Start program.exe %channel%

This, basically, prompts the user to select a channel number when they execute the batch script, and once they hit Enter, it starts the program.exe

0

I've an inkling we're not getting the full story here and program.exe is in fact a quoted parameter.

START "some programname in quotes" someparameter

will attempt to run the program someparameter with a window title "some programname in quotes"

If this is the case, the cure is:

START "some window title" "some programname in quotes" someparameter

Where "some window title" may be a quoted-empty-string if you wish, ie

START "" "some programname in quotes" someparameter

is perfectly legitimate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.