Jump to content











Photo

Drag and Drop onto a shortcut in Win8.1


  • Please log in to reply
4 replies to this topic

#1 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 11 April 2014 - 03:34 PM

I am not sure if this is a Windows 8/8.1 bug or what:

 

1. Create a .cmd file called test.cmd

2. Edit it to add

echo HERE
pause

3. Create a shortcut to this file on the desktop

4. Edit the Properties-Advanced of the shortcut to Run as administrator

5. Double-click on the shortcut and check you get the HERE prompt as expected.

 

 

Now here comes the test:

 

1. Select a file in a path that has no spaces - e.g. C::\temp\test.txt and drag-and-drop it onto the shortcut - say Yes to the UAC prompt and you should see a console windows with 'HERE' - press any key - as expected.

 

2. Now repeat this test, but select a file that is in a folder path that has spaces in it - e.g. C:\temp\name with spaces\t.txt

 

After accepting the UAC, a console window opens and then immediately closes!

 

It's driving me mad! :frusty:  :exclamation:

 

The console that opens has a blue background in my case, I see one line flash up and then it closes. I can't read what it says cos it's too quick.

 

 

P.S.

OK
I managed to solve it by using

c:\windows\system32\cmd /c C:\temp\test.cmd

as the shortcut 'Target' command

weird!



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 April 2014 - 03:56 PM

See if it works with either the %1 or %L parameter (in double quotes), i.e. in the Properties, either:
C:\temp\test.cmd "%1"
or
C:\temp\test.cmd "%L"

:unsure:

:duff:
Wonko

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 11 April 2014 - 03:57 PM

yes, see edit in first post!



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 11 April 2014 - 04:40 PM

yes, see edit in first post!

Yes, what? :unsure:
In the original post you solved it by spawning a new instance of CMD.EXE, I asked if providing a parameter (which is the actual file that has been drag-and-dropped) something different happened :dubbio:.

:duff:
Wonko

#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 11 April 2014 - 04:41 PM

Sorry, I thought you hadn't seen that.

using "%1" does not work.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users