-
July 26th, 2006, 10:37 AM
#1
Reading selected file in Windows Explorer
Hi there,
can any one help me to read the selected file through VB?
All I want to do is make multiple copies of a selected file from windows explorer. I mean if I click on a file in windows exp. and click right mouse button there will be my VB program select that then multiple copies should be made.
thanks in advance
regds.
-
July 26th, 2006, 10:51 AM
#2
Re: Reading selected file in Windows Explorer
I want to read file name with full path from the buffer and make multiple copies.
-
July 27th, 2006, 02:10 AM
#3
Re: Reading selected file in Windows Explorer
can any one help me on this? thanks in advance
-
July 27th, 2006, 08:49 AM
#4
Re: Reading selected file in Windows Explorer
Let's see. I don't think there is a direct VB solution....
First you have to add an item to the context menu (look here):
http://weblogs.asp.net/stevencohn/ar...07/406098.aspx
This describes how to add a command to the context menu.
You would have to use the name of your VB program and pass it the filename as command line parameter "%1".
In you VB program you use Command$ to access this filename and do with it whatever you like.
-
July 28th, 2006, 02:24 AM
#5
Re: Reading selected file in Windows Explorer
Thanks Wof.
I am fine with adding item to context menu by updating the registry.
My problem is when I select any file in windows explorer, I want to read that just selected file name with complete path of that file through VB.
I think there will be WIN API function for this, but I don't know which one it is and how to use it Please help.
thanks in advance
with regards
-
July 28th, 2006, 08:43 AM
#6
Re: Reading selected file in Windows Explorer
Glad taht you succeeded creating new context menu items. I didn't.
Which windows version do you use?
But if you succeed, you are almost there:
Assuming your VB program is called DoIt.exe, then your command key entry must be: DoIt "%1", the %1 passing the complete filename to your DoIt.exe.
That is, when you right click a filename and chose 'DoIt' for that file, your program is startet and the filename passed as a command line parameter.
The passed parameter is available in Command$, a predefined variable containing everything what goes after the program call.
Hope that helps.
And now my messing around with the registry got me stuck. My folders do not open anymore by default.
-
July 28th, 2006, 09:59 AM
#7
Re: Reading selected file in Windows Explorer
Hi WoF brilliant, I got it.
BTW I have Win xp SP2.
thanks for your help
regds.
-
July 28th, 2006, 10:06 AM
#8
Re: Reading selected file in Windows Explorer
Fine.
Would you mind telling my how you produced the menu entry?
I also have XP SP2 and followed the instructions from the link i supplied, but did not succeed in getting a new menu entry. What have I missed?
-
July 28th, 2006, 10:32 AM
#9
Re: Reading selected file in Windows Explorer
try the article below, clearly described. I used the same.
http://www.jfitz.com/tips/rclick_custom.html
BTW any idea of adding sub menu's to the context menu.
I mean like 'Openwith', then sub menu, where we can see list of programs, like that.
thanks in advance
-
July 28th, 2006, 10:49 AM
#10
Re: Reading selected file in Windows Explorer
Yes, great. Got it. I just missed the '*' as a separate key.
Concerning Submenus... I'm not sure about that.
There is always the 'Send to' submenu to learn something about. I may have a look over the weekened.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|