Hey Slowdown
Thanks for replying so quick! Using your method I reworked the sub just a little to try and get this to work. Heres a quick look at the test sub.
- Code: Select all
Private Sub CommandButton11_OnEvent()
Dim progPath as String = "C:\Program Files\Paint.NET\PaintDotNet.exe"
Dim progPath2 as string = "C:\windows\system32\mspaint.exe"
Dim progPath3 as string = "C:\Program Files\GIMP-2.0\bin\gimp-2.6.exe"
Dim returnpath as string
if radiobutton1.value = true then radiobutton2.value = false
if radiobutton2.value = true then radiobutton1.value = false
if radiobutton1.value = true then
if dir.isdir("C:\Program Files\Paint.NET") = true then
returnPath = Shell(progPath)
'Application.ExternalOpenFile(trim(lcase("C:/Program Files/Paint.NET/PaintDotNet.exe")))
'format()
'shell("C:/Program Files/Paint.NET"+"/PaintDotNet.exe", false)
else
returnPath = Shell(progPath2)
'Application.ExternalOpenFile("C:/windows/system32/mspaint.exe")
endif
endif
if radiobutton2.value = true then
if dir.isdir("C:/Program Files/GIMP-2.0/bin") = true then
'Application.ExternalOpenFile("C:/Program Files/GIMP-2.0/bin/gimp-2.6.exe")
returnPath = shell(progPath3)
else
returnPath = shell(progPath2)
endif
endif
End Sub
Now with this heres what happens, I get an error when trying to open paint.net or gimp saying c:\program is not a valid application. However, mspaint will open up just fine. So obviously the command sequence works, so why isnt it working on the other two directories. After further examination, the only difference I can find is white space. It would appear and after further testing that if the directory names have a space in them it breaks its ability to execute..........any ideas??
![Question :?:](images/smilies/icon_question.gif)