DOpus on U3 -> Making portable apps accessibles from toolbar

I tried to use this vbs script for several commands now with the file located in the DOpus folder.

But finally, I reach its limitations :wink:.

The Run method in VBScript can't handle command line redirection to a file.

I didn't found a workaround yet, but i'm searching some to see if there's a way to allow this!

You could do it by abusing the rename scripting functionality. Or just call it as an external batch file.

If you want DOS features like redirection then it's probably easiest to run a batch file from the script. Perhaps there is a way to do it using just VBScript but I don't know.

For what I saw yet, changing the last line of your code does the trick:

Shell.Run "%ComSpec% /c" & CmdLine & " > " & OutputFile, 1, WaitForCommand

OutputFile would be a parameter that the script gets....
But the main problem is here. When using the WScript.Arguments method (is it a method? i'm not sure though), the redirection parameter is ignored.

So, I guess the better thing to do would be to use another special character that VBScript won't discard as argument to indicate the script that the redirected filename is coming right after.

I'll try to make something like this soon (being able to handle both normal command launch & command with redirection), and post the code here!

I knew I had to go through VBScript again sooner or later :wink:, even if it's not what I prefer.
I'm not that much into scripting :wink:, but way more into programming using good old C & ASM when needed :smiley:

Anyways, thanks a lot again for your quick help!

Using cmd.exe, good idea!

Yeah, you'll need to pass something other than ">" as an argument to the VBScript, then have it replace the special thing with ">" when sending the line to cmd.exe.

Here we go, here's the script updated!

It feels good :slight_smile: I'll finally be able to put all my little own & other command line tools to help about software development on my USB key being able to use also redirection!!!!

DOpus rules :wink: This will save me a lot of time about these little commands I use almost every day!

Thanks again for all the great help, I could have searched for a while otherwise!
LaunchViaLabel(v2).zip (1.7 KB)