Help - Search - Members - Calendar
Full Version: Use of Shell Function
BleepingComputer.com > Software > Programming
   
jai2k
Hi,

I am using Shell function in VB to open the file.
shell(path of the exe,path&filename)

If the filename has spaces in between , I have a problem because the file name is truncated after spaces.hence the error "File not found"

I can't add Quotes "" before the path of the filename because it is a variable.

Can anyone help pls

Thank you
jai
LoLucky
Might help some to understand What you are looking for if you post your Code
You can use the Code button to post it correctly

As noted above i'm not sure what you are looking for But you can try

CODE
Dim File1 As Double


File1 = Shell(path,vbNormalFocus)


where path is "C:\Program Files\Som Other File With Spaces\File to Topen.exe"

Hope that helps,
raw
location = Chr(34) + "C:\Program Files\My Program\Prog.exe" + Chr(34)

file = Chr(34) + Text1.Text + Chr(34)

Shell location + " " + file, vbNormalFocus

-------------------------------------------------------------------

Shell "notepad ""C:\dir with spaces\test.txt""", vbNormalFocus
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.