Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Example: If I were viewing example.txt in a Notepad and editing an image in GIMP, I'd like to generate a batch file that would launch those files using those applications after I've closed the windows. Is there a way to create a launcher like this without manually copying and pasting the names of open files and applications into a batch file or shell script?

share|improve this question
    
Could you please clarify... If they are open already, why would you need a launcher for them? –  john May 1 '12 at 21:07
    
So you could open that set of files in those apps in future, just by running the batch file? –  john May 1 '12 at 21:10
    
I want to generate a launcher for all the open windows so that I can quickly launch all the windows again after closing them. –  Anderson Green May 1 '12 at 21:10
    
Yes, that's what I'm trying to do. –  Anderson Green May 1 '12 at 21:11
    
Does this help? stackoverflow.com/questions/958123/… –  john May 1 '12 at 21:16
add comment

1 Answer

up vote 2 down vote accepted

Yes, you can, if you use PowerShell etc.

Use

get-process | select name

this will get a list of process names

Now you can find the commandline for the process names you interested in with the following

gwmi win32_process -filter "name=$processname'" | select commandLine

Now you can use PowerShell to create shortcuts

You can create a simple script do what you want, as there are other things you may want to add for the shortcuts other than the commandline (which is your target in the shortcut) and process name.

share|improve this answer
    
I like when responses start with "Yes, you can." :) –  BloodyIron May 1 '12 at 21:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.