dslreports logo
 
    All Forums Hot Topics Gallery
spc
Search similar:


uniqs
457

spatula_city1
join:2001-05-09
Fullerton, CA

spatula_city1

Member

[WIN7] Run a command when opening a folder

I'm trying to figure out a way to run a command or script (specifically: to open a browser window to a website) when a user opens a specific desktop folder in Windows7. This is for a small computer lab in a school.

Ideally, the folder will still remain open but just launch a web browser on top of it so that students will be inclined to fill out the survey.

I know about the start-up folder (which can launch the survey for all users) but I want this survey to pop up only for students who are interested in content in a certain desktop folder.

My research has led me nowhere. I looked at using an autorun.inf file in the folder, but that doesn't seem to work. Any other ideas?

Thanks.

Kalford
Seems To Be An Rtfm Problem.
MVM
join:2001-03-20
Ontario

Kalford

MVM

You can accomplish this fairly easily using RoboTask Automation software.

»www.robotask.com/

1. create new task.
2. add "general" action that launches/runs desired program/script.
3. add a "window watcher" trigger event to the task that will activate whenever a "window" for that folder is created.
(have the "to watch" folder open while you are creating the task. that way it will show up in the drop-down when you are creating the trigger event.)


edit note: just figured another way to do this without robotask. . .will post up shortly.
dave
Premium Member
join:2000-05-04
not in ohio

dave to spatula_city1

Premium Member

to spatula_city1
To my mind you're doing it backwards. Instead of running a program when the user opens a folder, I'd go with opening a folder when the user runs a program.

Assume the thing on the desktop is a program of some kind, maybe a script. When double-clicked, it can (a) fire off a web browser pointing to a particular URI, and (b) open up a folder in Explorer.

spatula_city1
join:2001-05-09
Fullerton, CA

1 edit

spatula_city1

Member

The reason I'm looking for a folder to launch a web browser is because the specific student group already have their software and links all contained in a desktop folder and I simply want to pop up a survey to just this specific group of students who are already going to enter that desktop folder anyways.

Kalford
Seems To Be An Rtfm Problem.
MVM
join:2001-03-20
Ontario

1 edit

Kalford to spatula_city1

MVM

to spatula_city1
okay. . .so instead of actually having a folder on your desktop, you will have a shortcut with an icon of a folder. . . that when clicked on will launch a bat file.

that file will launch your folder first. . .then launch the default browser to the url of your survey. (keep the order. . . so your survey isn't behind the folder window)

step one. . .create the batch file: it's a two liner that you can make in Notepad.

%SystemRoot%\explorer.exe "D:\DesiredFolder"
explorer "http://SurveyAddress.com"
 

save the file with a .bat extension. . ie. Launch_folder.bat
(save it somewhere besides your desktop)

step two. right click on the bat file and choose "send to - desktop (create shortcut)"

step three: rename the short cut on your desktop to the same name that your folder is. (just to make them think they are opening a folder)

step four: right click on the shortcut. Choose properties. on the "shortcut" tab - click on change icon. Select an icon that looks like a folder (or whatever you desire to use).

you're done. :-)

edit: well almost done. . . I just saw your follow-up post stating that the folder already exists with all the links etc. . .

step 0. move that folder (and it's contents elsewhere (off the desktop). . .put the shortcut to the batch file in the folder's former spot on the desktop.

(now you're done)

spatula_city1
join:2001-05-09
Fullerton, CA

spatula_city1

Member

Thanks, nice solution. Know of any way to have the shortcut folder icon not have the arrow (indicating a shortcut) in the corner?
dave
Premium Member
join:2000-05-04
not in ohio

dave to spatula_city1

Premium Member

to spatula_city1
If there was a Windows-supported way to run a program on opening a folder, it would surely be implemented via desktop.ini. Alas, no.

»msdn.microsoft.com/en-us ··· 85).aspx

Probably what you want used to exist via Folder.htt, but that was removed as a security concern. It does not exist after XP as far as I know.

»support.microsoft.com/kb/819028

spatula_city1
join:2001-05-09
Fullerton, CA

spatula_city1

Member

Yeah, I was vaguely remembering something back in the W98 days when active desktops were around.

Kalford
Seems To Be An Rtfm Problem.
MVM
join:2001-03-20
Ontario

Kalford to spatula_city1

MVM

to spatula_city1
said by spatula_city1:

Thanks, nice solution. Know of any way to have the shortcut folder icon not have the arrow (indicating a shortcut) in the corner?

You can remove the arrow from all shortcuts with a registry hack. . or with utilities such as the one mentioned on the following link.

»www.pcworld.com/article/ ··· ons.html

however - I don't believe that you can toggle them individually.


spatula_city1
join:2001-05-09
Fullerton, CA

spatula_city1

Member

Thanks. according to these instructions:
»www.sevenforums.com/tuto ··· ore.html
I could probably use a custom ICO file and aplpy the registry fix for that custom icon file. Instead, I just used the reg file and removed all of the shortcut arrows from all of the shortcuts on the system. Doing this allows the full icons on the system to display for shortcuts which may also help students identify software.

Thanks.

Kalford
Seems To Be An Rtfm Problem.
MVM
join:2001-03-20
Ontario

Kalford

MVM

You're welcome.

Should the need or desire arise. . . one way that you could have some shortcuts with arrows and some without is to apply a bit of reverse strategy (and a bit of "elbow grease" )

preliminary step - apply registry fix to remove arrows as a default.

for the shortcut(s) where you would like an arrow to be present. . .

identify the source file(s) for the icon(s). (properties - change icons - will show source)

using an app such as nirsoft's IconsExtract, extract and save a copy of the icon from the source.

»www.nirsoft.net/utils/ic ··· ext.html

using an image app such as photoshop or faststone's image resizer, add an arrow (or other indicator) to the icon(s).

»www.faststone.org/FSResi ··· tail.htm

save the modified icon in a folder named "custom icons"

point the shortcut to the icon.

19579823 (banned)
An Awesome Dude
join:2003-08-04

19579823 (banned) to Kalford

Member

to Kalford

quote:
You can remove the arrow from all shortcuts with a registry hack. . or with utilities such as the one mentioned on the following link.
Indeed ya can...... I had Regseeker remove the pesky arrows!! (It sets a blank overlay by putting a key in the reg which points to it)