Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • September 03, 2015, 08:36:24 PM
  • Proudly celebrating 10 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 20045 times)

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • 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.)
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 8,858
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • 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: 886
    • 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
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • 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!
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!

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: 886
    • 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
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
« Last Edit: January 23, 2009, 07:04:16 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: 8,858
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Donate to Member
Skrommel: so it clobbers the clipboard?
- carpe noctem

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 886
    • 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
Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.

f0dder

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

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 6,763
    • View Profile
    • Donate to Member
Re: IDEA: Fix Vista so I can drop a file from Windows Explorer to cmd yet again
« Reply #11 on: November 05, 2009, 01:29:22 PM »
@skrommel:
On your page, 'DropCommand' has wrongly been named "RunToClose" (the second one).

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 822
    • View Profile
    • Donate to Member
Re: IDEA: Fix Vista so I can drop a file from Windows Explorer to cmd yet again
« Reply #12 on: November 05, 2009, 08:35:56 PM »
Ha! I can't believe it! Microsoft restored the original functionality in Windows 7!
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 8,858
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Donate to Member
Re: IDEA: Fix Vista so I can drop a file from Windows Explorer to cmd yet again
« Reply #13 on: November 06, 2009, 11:38:43 AM »
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: 822
    • 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.
If bad things happen to other people, it's karma. If bad things happen to me, it's kismat!

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
Re: IDEA: Fix Vista so I can drop a file from Windows Explorer to cmd yet again
« Reply #16 on: September 25, 2013, 01:54:44 PM »
 :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.