Mangix Posted October 16, 2006 Share Posted October 16, 2006 here's the story. i am trying to make a right click menu which is supposed to re-compress a PNG file using IrfanView. the right click menu calls a .bat file named cvrtopng.bat which has the following.cd "C:\Program Files\IrfanView"cvrtopng.vbs %1the cvrtopng.vbs file has the following code.If WScript.Arguments.Count = 1 Then orgName = WScript.Arguments.Item(0) savName = Replace(orgName, ".png", "-compressed.png") Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.Run("C:\Program Files\IrfanView\i_view32.exe" & orgName & "/convert=" & savName)Else MsgBox("Use the parameters properly, b***h!")End Ifthe problem is, a messagebox appears and says it can't find the file. the line is 5 and the char is 2(which seems weird). so can anyone tell me how to fix this? Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 16, 2006 Share Posted October 16, 2006 Try this Set WshShell = CreateObject("WScript.Shell") IrfanView = WshShell.ExpandEnvironmentStrings("%ProgramFiles%\IrfanView\i_view32.exe") WshShell.Run(Chr(34) & IrfanView & Chr(34) & " " & orgName & " /convert=" & savName)Else Link to comment Share on other sites More sharing options...
Mangix Posted October 16, 2006 Author Share Posted October 16, 2006 that works like a charm. Thank You! Link to comment Share on other sites More sharing options...
gunsmokingman Posted October 16, 2006 Share Posted October 16, 2006 Your welcome glad I was able to help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now