AutoHotkey Community

It is currently May 27th, 2012, 3:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: November 2nd, 2009, 4:00 pm 
Hi,
this may be a newbie question; nevertheless I'd be grateful for an answer as I spent a long while already on this...

I have a full file path in a variable. I try to open the Windows Explorer such that it opens the corresponding directory and has the filename selected.

This is my code:
Run, Explorer, "/select,%MyVar%"
%MyVar% contains the fullpath. Actually other things happen as well (Subversion update of the file, opening of the file, ...), but let's disregard this for now.

However, when I run this, Windows Explorer opens, but not with the correct folder. Instead, "My documents" is opened.

What am I doing wrong? I have checked http://support.microsoft.com/kb/314853 and understood the switches, but do not reach my goal.
Run, Explorer, /select,"%MyVar%" does not work either.

Thanks for any help,

Frank


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 4:04 pm 
Offline

Joined: May 17th, 2007, 12:07 pm
Posts: 1004
Location: Germany - Deutschland
Try:
Code:
%systemroot%\explorer.exe /n,/e, "%MyVar%"


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Doesn't work
PostPosted: November 2nd, 2009, 4:45 pm 
Sorry, doesn't work. I wrote
Run, %systemroot%\explorer.exe /n,/e, "%MyVar%"
which gives an error:
Error: Failed attempt to launch program or document:
Action: <\explorer.exe>
Params: </n>

The current thread will exit.

Specifically: Das System kann die angegebene Datei nicht finden. (meaning: System cannot find the specified file).

Any other ideas? I presume that it has something to do with the quotes and the sequence of parameters.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 2nd, 2009, 4:58 pm 
Code:
Run, % systemroot "\explorer.exe /n, /e , "" MyVar """,, Max
Have a try with this. Not tested


Report this post
Top
  
Reply with quote  
 Post subject: Solved
PostPosted: November 2nd, 2009, 6:02 pm 
Finally got it running:

explorerpath:= "explorer /select," MyVar
Run, %explorerpath%


Simple in the end...


Report this post
Top
  
Reply with quote  
 Post subject: Re: Solved
PostPosted: May 16th, 2010, 11:52 am 
Offline

Joined: April 24th, 2009, 7:06 pm
Posts: 87
FrankDx wrote:
Finally got it running:
Code:
explorerpath:= "explorer /select," MyVar
Run, %explorerpath%

Simple in the end...


This helped me out in the end, too.
Use this to explore "userfolder"
Code:
explorerpath:= "explorer /e," userFolder
Run, %explorerpath%


Thanks,
Deep-Silence


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, rbrtryn and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group