CONTENTS OF CODE WINDOWS ON THE FORUM ARE BEING CORRUPTED OVER TIME AND THE CODE NO LONGER WORKS. BECAUSE OF THIS THE CODE HAS BEEN MOVED INTO THIS README FILE AND APPEARS BELOW THE INSTRUCTIONS INSTRUCTIONS 1. Delete all text down to and including the line CODE STARTS HERE. Click on File on the menu and select Save As. Hold down the ALT key and click the Up arrow on the keyboard several time until the Desktop folder is shown above the files pane. Click on down arrow at end of "Save as Type" box below the files pane. Choose "All files". Edit the file name to IV_launch 2.vbs and Save If you later need to edit the vbs script file, open it again in Notepad or similar text editor. It is recommended that you uncheck Word wrap from the Format menu and make the window wide enough so that full lines of code (including the comments) can be seen. This also allows the Status bar to be turned on from the View menu should you wish to investigate any errors reported by the script software while running. 2. Line 2 of the script contains the full path to the Irfanview i_view32.exe file. If the message appears that the script file cannot find this file, right click on a shortcut to Irfanview (if you have one), select Properties and copy the location from the Target box. Otherwise search for i_view32.exe, right click it, select "Open file location" and copy the path of that folder. 3. Line 3 of the script specifies the location of the file in which the dragged files are listed temporarily. The long parameter starting with "FSO." uses the File System object created in line 1 to return the path of the folder in which the vbs file is located. This will probably be a suitable location for the temp file, unless you choose to relocate the script to a protected area such as the Program files folder where it then may not be possible to either create the temp file or to write to it. The script file should not normally need to be put in a protected area but if you chhose to do so you will need to replace the parameter with a path to a folder somewhere else that you know will always be available to create the temporary file in. This temporary file is deleted automatically when the final Irfanview window that you opened from the script is closed. Meanwhile, while a window is open, you are able to open that temporary file to inspect or copy the file list should you so wish. 4. Line 4 contains a Filter string to specify which file types you want to include in the list. It has been deliberately written so that the string between the quote marks is in the same form as is used in the "Load custom file types" box in the Extensions tab of Properties/Options. That enables you to copy and paste whatever is in that box to between the quotes here if you want to allow all those file types. The delimiter between each extension type is the Pipe character | (Shift + \). Should you want every possible file type to be accepted just delete the whole string and leave blank the area after strFilter=. 5. If you decide that you want to use this script file regularly each time you open Irfanview this way, it will usually be better to move it to somewhere more convenient such as in your User Appdata area or a Public folder. You can create a shortcut on the desktop that acts as an Irfanview shortcut. Right click on the script file and drag it to the desktop. In the popup box that appears select "Create shortcut here". Rename the shortcut as "Irfanview". Right click on the shortcut and select Properties. Select "Change icon" and in the dialog Browse to the i_view32.exe file. Select one of the Irfanview icons and press OK twice to close the dialogs. You can then drop files onto this shortcut instead of directly onto the script file and Irfanview will open. 6. Any problems let me know by private message on the forum or as an open post in this thread if you think your findings might also interest other users. 'CODE STARTS HERE Set FSO = CreateObject("Scripting.FileSystemObject") strApp= "C:\Program files\Irfanview\i_view32.exe" 'Location of Irfanview exe strTempfile= FSO.GetParentFolderName(Wscript.ScriptFullName) & "\listfile.txt" 'Location of Temp file strFilter= "JPG|JPEG|JPE|GIF|BMP|DIB|TIF|TIFF|PNG|PCX|TXT|PDF" 'Include just these file types If FSO.FileExists(strApp) then 'Check that App file exists strApp = chr(34) & strApp & chr(34) 'Add quote marks around strApp Set Shell = CreateObject("WScript.Shell") Select Case Wscript.Arguments.Count 'How many files were passed? Case 0 Shell.Run strApp 'No files. Just open Irfanview Case 1 If Suffix(WScript.Arguments(0))= "TXT" then '1 file. Check if Txt file Shell.Run strApp &" /filelist=" & WScript.Arguments(0), 1, true 'Open Irfanview with file list Else Shell.Run strApp & " " & Wscript.Arguments(0) 'Open Irfanview with image End If Case Else Set f1 = FSO.OpenTextFile(strTempfile, 8, True) 'Multiple files. For n=0 to Wscript.Arguments.Count-1 'Check which to include If Checkout(WScript.Arguments(n),strFilter)=True then f1.WriteLine Wscript.Arguments(n) 'and add to list Next Set f1 = FSO.GetFile(strTempfile) mysize = f1.size 'Record present size of temp file Shell.Run strApp &" /killmesoftly", 1, true 'Close any existing Irfanview windows Shell.Run strApp &" /filelist=" & strTempfile, 1, true 'Open Irfanview, then wait for it to be closed If f1.size = mysize then FSO.deletefile (strTempfile) 'Delete temp file if size is unchanged End Select Set shell = Nothing Else 'Cannot find Irfanview msgbox strApp & " not found." & vbCrLf & "Please edit Line 2 of " & Wscript.ScriptFullName End If Set FSO = Nothing Function Checkout(filetype,filter) If len(filter)<2 then Checkout=True : Exit function 'Always accept if filter is empty filetype ="|" & Suffix(filetype) & "|" 'Add delimiters to ends of suffix filter = "|" & filter & "|" ' and of filter If Instr(filter,filetype)=0 then Checkout=False else Checkout=True 'Accept only if specified file type End Function Function Suffix(filename) 'General function to return file suffix dot=InstrRev(filename,".") If dot=0 then Suffix = "None" Else Suffix= Ucase(Right(filename, len(filename)-dot)) End If End Function