Open folder in same window from autorun file

I'm wondering how I can open a folder from an autorun file from a flash drive. I have it working right now, however when you double click the icon, it opens the folder in a new window. I would like it to do something similar to the: right click > open command.

Attached is my current autorun.inf
[autorun]
icon=.\VolumeIcon.icns

shellexecute="Programs\Shortcuts\"
action=View Programs

shell\verb=View Flash Drive
shell\verb\command="explorer.exe \"

[content]
MusicFiles=false
PictureFiles=false
VideoFiles=false

Open in new window

LVL 5
bswinnertonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve KnightIT ConsultancyCommented:
try changing it instead to "explorer ."  

That works for me anyway.

Steve

START "" .
0
Steve KnightIT ConsultancyCommented:
Actually scrub that, sure it worked the first time but then it didn't!!
0
bswinnertonAuthor Commented:
Anybody have any ideas?
0
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

BillDLCommented:
Try these:

explorer.exe .\
explorer.exe .\Programs\Shortcuts\

or

explorer.exe /e,.\
explorer.exe /e,.\Programs\Shortcuts\
0
jostranderCommented:
This took some trickery, but I got it working for me.

Notes:
1) If you've already mounted the drive once, Windows may cache your existing autorun info.  So any changes may not even take effect.  To remove the cached entry, go to:
HKEY_CURRENT_USER\Softwre\Microsoft\Windows\CurrentVersion\Explorer\MountPoints
Find the entry for your mount (be it flash/cd/network/etc) and delete it.

2) To enable it to work regardless of your current folder view (open or explore), a ddeexec value has to be added.  See the code below for more info.
[autorun]
icon=.\VolumeIcon.icns

shell=Default

shell\Default=View Programs
shell\Default\command="Explorer"
shell\Default\ddeexec="[ViewFolder("%lPrograms\Shortcuts",null,null)]"

shell\BrowseThis=View Flash Drive
shell\BrowseThis\command="Explorer"
shell\BrowseThis\ddeexec="[ViewFolder("%l", %I, %S)]"

[content]
MusicFiles=false
PictureFiles=false
VideoFiles=false

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bswinnertonAuthor Commented:
Doesn't quite work in Vista, but that's an entirely different hurdle. Thanks for the help!
0
jostranderCommented:
Yeah, security in win7/vista is a bit tight for non-optical + autoplay.  I used to use shelexec.exe with my autorun.inf files to do stuff like this... now that I finally figured out how...it's going obsolete :)

Fun project though... thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft DOS

From novice to tech pro — start learning today.