Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.| Important Announcement: We have two terrific contests running on the site that I wanted all our members and guests to know about. The first contest is the HP Magic Giveaway, which is underway as of November 28th. More information can be found at this topic, which will be updated very soon with further information. The second contests, is for the chance to win two Seagate FreeAgent external hard drives. More information about this contest can be found here. These are both amazing contests and I suggest everyone submit an entry for them. - BleepingComputer Management |
![]() ![]() |
Dec 7 2004, 06:16 AM
Post
#1
|
|
|
New Member ![]() Group: Members Posts: 6 Joined: 23-November 04 Member No.: 5,691 |
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 |
|
|
|
Dec 7 2004, 08:57 AM
Post
#2
|
|
|
Forum Regular ![]() ![]() ![]() Group: Members Posts: 331 Joined: 11-October 04 Member No.: 3,520 |
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, This post has been edited by LoLucky: Dec 7 2004, 09:13 AM |
|
|
|
Dec 7 2004, 12:57 PM
Post
#3
|
|
![]() Bleeping Hacker ![]() ![]() ![]() ![]() ![]() ![]() Group: BC Advisor Posts: 1,981 Joined: 14-April 04 From: Texas Member No.: 151 |
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 -------------------- |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 4th December 2008 - 05:20 PM |