473,382 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

"Show this file in explorer"

rodmena
I have a big problem. I have a list of files that my script find and
list them in a little gui.
I need this function:

when i d-click on each item, I want explorer opens and selects that
item inside windows explorer.
like that beautiful buttom in iTunes.
what is that trick?


Thanks in advane.

Farshid Ashouri.
Dec 1 '07 #1
2 1257
dazzler
75
I have a big problem. I have a list of files that my script find and
list them in a little gui.
I need this function:

when i d-click on each item, I want explorer opens and selects that
item inside windows explorer.
like that beautiful buttom in iTunes.
what is that trick?


Thanks in advane.

Farshid Ashouri.
Expand|Select|Wrap|Line Numbers
  1. import os
  2. os.system("c:/windows/explorer.exe")
  3.  
this opens the exlorer

you must know the file path/file name in your application which you want to show in explorer, when you have made that code, use

os.system("c:/windows/explorer.exe /select,c:\test.txt")

this would now open explorer and select "test.txt"

I would prefer to use /n option also...
os.system("c:/windows/explorer.exe /n,/select,c:\test.txt")

now it removes that nasty file tree view from the left ^^

more info about windows explorer.exe http://support.microsoft.com/kb/130510

ofcourse this isn't the perfect solution, because windows folder must be at c:/windows for this to work... I think that you can check where's your windows folder using os module, but I'm not sure
Dec 3 '07 #2
dazzler
75
a little better version

Expand|Select|Wrap|Line Numbers
  1. import os
  2. os.system("%SYSTEMROOT%/explorer.exe /n,/select,c:\test.txt")
  3.  
so now %SYSTEMROOT% points out always to windows folder, despite wherever place the windows folder is

some info about environment variables http://vlaurie.com/computers2/Articles/environment.htm
Dec 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: MAK | last post by:
I'm stumped. I'm trying to use Python 2.3's urllib2.urlopen() to open an HTML file on the local harddrive of my WinXP box. If I were to use, say, Netscape to open this file, I'd specify it as...
1
by: eddie wang | last post by:
I have the following Javascript. function show(d){ if(obj=document.all(d)) obj.style.display="" } The html then callsd 'show("div6"). But, what is ("div6") and where it is defined? I know...
1
by: Jesper Hermansen | last post by:
Hi! I'm making a system that will generate Winamp-playlists. To make it easy for the user to add a file to the list, I'm using <input type="file">. The problem with this is that I only get...
10
by: Dieter Salath? | last post by:
Hi, in our webpage, a user could open a windows explorer to his temp directory with a simple link and usage of the file protocol: <a href="file://C:\temp" target="_blank">C:\temp</a> This...
2
by: news.bellatlantic.net | last post by:
I created a for with file inputs (<input type=file.../>) I named them file1, file2, file3 etc. How do I access them in the code behind without actually calling each one by name (there are 21 of...
2
by: Susan Baker | last post by:
Hi, I am (trying) to compile some code I downloaded from the internet. The sources contain references to header files - using the form : #include <pathname/file> If I change the form to...
0
by: jeffrey.bigham | last post by:
Hello, I'm developing a small application that uses the WebBrowser control to display a webpage. I'd like to programatically access the "Show Pictures" option to turn images on and off. ...
1
by: acmdo | last post by:
Hello, The following question is about the name of file, with commas and periods, using VB.net 2005 when I try to use the process.start instruction I can open a file in explorer with...
7
by: farsheed | last post by:
I have a big problem. I have a list of files that my script find and list them in a little gui. I need this function: when i d-click on each item, I want explorer opens and selects that item...
0
by: =?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= | last post by:
Hi, well i had no need for it until today, so how can i bring up the "Backup and Restore" Dialog in Vista? In W2K and XP its still ntbackup.exe but with vista it changed to something like a...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.