![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Vista Home Premium 64 bit SP1 | drag & drop "open with.." additional params Anyone know if it is possible to create a shortcut drag & drop target so that when I drag a program and drop it on the shortcut, then select "open with" the shortcut that is dropped on can insert the name of the dropped program into the command line params? IOW, say I want a shortcut that opens a program at x y 100 100 no matter what I drop on it. My program knows how to do the positioning but it needs to read the name of the dropped program as well as the rest of the params in its shortcut. I've tried MyProg.exe "%1" x y in the target line but when I drop anything on it and do Open With I get "%1" not found. Is there a magic bullet? |
My System Specs![]() |
| | #2 (permalink) |
| Windows 7 RC x64 Vista HP x86 | Hi MilesAhead, I think that to do this you will need to create your shortcut to some form of script file ( VBScript, Powershell etc. that can then call your program and pass the parameters as needed. I can't help with the script but it should be achievable for someone who knows more than I do, You may want to try posting directly to one of the MS script newsgroups. sorry can't be of more help but hopefully maty point you in the right direction may seem silly but have you tried %1, %2, %3 etc. Last edited by dmex; 09-14-2008 at 11:02 PM.. |
My System Specs![]() |
| | #3 (permalink) |
| Vista Home Premium 64 bit SP1 | Re: drag & drop "open with.." additional params Thanks for the reply. I could just do a .cmd file to call my program: @echo off Myprog.exe "%1" param2 param3 param4 I was just hoping I could do it on the shortcut Target line. One would think there'd be a way to insert a symbolic substitution but this is Windows we're talkin' about so... Last edited by MilesAhead; 09-14-2008 at 06:18 PM.. Reason: man I don't understand where all these typos come from |
My System Specs![]() |
| | #4 (permalink) |
| Windows 7 RC x64 Vista HP x86 | Re: drag & drop "open with.." additional params It's the ghost in the machine or is it The gremlins |
My System Specs![]() |
| | #5 (permalink) |
| Vista Home Premium x64 SP1 | Re: drag & drop "open with.." additional params For example I just did an experiment here... Normally the command to print from metapad is: c:\pathto\metapad.exe /p d:\pathto\myfile.txt So I made a desktop shortcut with the command: c:\pathto\metapad.exe /p (notice there is no %1) Then I dropped a textfile onto that shortcut and it printed it. I think in your case, when you included %1 in your shortcut's command line, the name of the dropped file ends up being included twice in what actually gets executed. So try it without the "%1", only with the other parameters or command line switches your program wants. |
My System Specs![]() |
| | #6 (permalink) |
| Vista Home Premium 64 bit SP1 | Re: drag & drop "open with.." additional params So you're saying the param gets stuck on the end of the line? See I don't understand why it can't be positioned with a placeholder. Oh well, it's just an idea. Instead of drag & drop it would prolly be easier to use a DosKey macro. Then I can use $1 $2 to position the params within the constant params. You'd think positional substitution would've been thought necessary by now but I guess it's make yet another wrapper for the wrapper. |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| No "accounts" name in the "Tool" drop down menu. | Vista mail | |||
| Drop down window upon right click of desk top "Open" will not open | Vista General | |||
| How to turn off "rich drag and drop"? | Vista file management | |||
| Explorer restarts after "drag & Drop" | Vista General | |||
| Access denied trying to "md"? Drag & Drop is now drag, drop, OK, OK ???? | Vista installation & setup | |||