topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Wednesday December 11, 2024, 7:04 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Fix Vista so I can drop a file from Windows Explorer to cmd yet again  (Read 34836 times)

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
This is my first post, and it doesn't really seem right for my first post to be asking for something!  :P I may have a candidate for a coding snack, though.

Here is my idea. In every version of Windows from Windows 95 to Windows XP, I found that I could drag a file from Windows Explorer into a cmd window and Windows would put the path to the file on the command line. This worked with both executables and data filenames. I think this was extremely handy if you use any command line tools at all, especially with the length of directory paths these days. Vista broke this functionality just to be mean*, maybe someone knows an easy way to make something that would restore this functionality in Vista.

(And yes, I know you can work around it by holding down Shift and right clicking on the file and choosing Copy as Path, so if this coding snack never gets...munched on? I will live.)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Don't worry about your first post being a request, you posted it in a nice tone rather than "GIMME I DESERVE THIS!" :-)

I think the problem might have something to do with console applications running under ClientServer Runtime System (CSRSS)... an CSRSS runs as a system service (ie., higher privilege than even user accounts with admin privileges), and iirc Vista disables communication between lower- and higher-privilege applications.

I'm not 100% about this though, but it would explain why the functionality was dropped.
- carpe noctem

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
:) Try DropCommand!

DropCommand - Enables drag and drop of files to a command window in Vista.

Features:

- Drop multiple files.



You'll find the downloads and more info at 1 Hour Software by Skrommel.

Skrommel

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
 :Thmbsup: :Thmbsup:  :D :Thmbsup: :Thmbsup:

I can't believe it! I followed the link f0dder gave to the Microsoft blog, and it seemed impossible even for a third party utility.

You are a genius!

basementjack

  • Supporting Member
  • Joined in 2009
  • **
  • default avatar
  • Posts: 4
    • View Profile
    • Donate to Member
Skrommel - how does dropcommand work -
is it making a one time change (ie registry?)
or is it something we need to run each time?

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
 :( You need to keep it running.

DropCommand places an OLE enabled window underneath the mouse pointer whenever it hovers over a command window, and then copies and pastes the files dropped to the command line.

 :) It could even be extended to accept dropped text.

Skrommel
« Last Edit: January 23, 2009, 07:04 PM by skrommel »

mabra

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 1
    • View Profile
    • Donate to Member
Hi !

I tried DropCommand on a windows server 2008. Its running and staying in the tray. But if I dro a file from the explorer to an open dos window, nothing happens and I see the usual "blocked" symbol.

Waht can I do??

Thanks--mabra

war59312

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Will's Blog
    • Donate to Member
Nice tool, but the sound effect is very annoying. Option to disable it please?
God Bless America

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Skrommel: so it clobbers the clipboard?
- carpe noctem

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
 :tellme: @mabra: Is the command window's class called ConsoleWindowClass?

@war59312: No option unless you edit the source code or empty the wav file. Just create an empty text file and rename it to DropCommand.wav.

@f0dder: It restores the clipboard after the drop is complete.

Skrommel

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
@f0dder: It restores the clipboard after the drop is complete.
:Thmbsup:
- carpe noctem

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
@skrommel:
On your page, 'DropCommand' has wrongly been named "RunToClose" (the second one).

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
Ha! I can't believe it! Microsoft restored the original functionality in Windows 7!

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Ha! I can't believe it! Microsoft restored the original functionality in Windows 7!
A lot of things happened internally from Vista to Win7, so it's probably more a question of cmd.exe no longer running in the security context of CSRSS rather than "MS fixed it" :)
- carpe noctem

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
@skrommel:
On your page, 'DropCommand' has wrongly been named "RunToClose" (the second one).

I noticed that, and went and found this thread again to figure out why the name changed.
You can see the incorrect name here. The name is correct at the top of the page, only incorrect at the screenshot.

CrawlerBrinx

  • Participant
  • Joined in 2012
  • *
  • default avatar
  • Posts: 17
    • View Profile
    • Donate to Member
Hey, how about to make the tray icon more useful? it would be nice if double click would open the console instead of an "about" window.
I'm also not sure if that is possible, but it would nice to be able to drag-n-drop a file directly to the tray icon of the script, so it would open a new cmd window and paste the dropped file's path there.

dilentec

  • Participant
  • Joined in 2011
  • *
  • Posts: 1
    • View Profile
    • Donate to Member
 :D This is definitely a must have. If the dropping sound could be an optional feature it would be just perfect. Thanks for sharing. Donations on their way.