Jump to content

Recommended Posts

Posted

Folks,

I'm writing a prog that sets up a new item on the file context menu (right click menu). It works fine but I see that if I select a filename with a space in it, $CmdLine[1] is truncated at the 1st space in that filename. Putting " around it doesn't help as it's already truncated by the time I get it.

Is there a way around this or can I get to the whole command line so that I can parse it myself?

I understand that example code may help but it's not quite ready yet. I'll post it tomorrow morning if required.

Regards,

4Eyes

Posted

Hi,

$cmdLineRaw will help you and the code will help us helping you more :-)

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Posted (edited)

Here is an example that I use out of a .reg file

[HKEY_CLASSES_ROOT\Folder\shell\CMD\command]

@="cmd /k cd \"%1\""

Edit:

Better Example

.reg

Windows Registry Editor Version 5.00



[HKEY_CLASSES_ROOT\Folder\shell\Clip Path\command]

@="C:\\scripts\\right-click\\rc.exe \"%1\""




[HKEY_CLASSES_ROOT\*\shell\Clip Path\command]

@="C:\\scripts\\right-click\\rc.exe \"%1\" "

.au3

#NoTrayIcon



If $CmdLine[0] <> 1 Then Exit(1)

ClipPut($CmdLine[1])

Exit(0)
Edited by blakel
Posted

blakel,

Ah... thanks, but your reply has nothing to do with my problem.

Xenobiologist,

That hits the spot nicely. As usual, I DID look in the help file but didn't see that. I thought it may have been a problem with still using 3.3.0 so I've also upgraded to 3.3.6.0.

If anybody is interested I'll post the completed code tomorrow.

Thanks heaps,

4Eyes

Posted

blakel,

Ah, sorry... if I simply use this "%1", instead of just %1 then I get exactly what I want. Thank you. I didn't initially understand what you had given me.

Regards,

4Eyes

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...