Followers 0

# Newbie Questions: Can You Run Visual Basic Files?

## 6 posts in this topic

I want to make a script that opens a visual basic program (.vbp) and then runs that program (F5).

This is just the start of something I want to do on a much larger scale but i can't seem to figure out how to do this. Though I will admit I have not spent too much time looking around. I'm new to this program.

I tried to use the Run("") function but it says it cannot open a non-exe file. Is there some other function that i do not know of? Like a function that double clicks on a file but does not open its folder?

Like maybe: dclick(file locaiton) or pressenter(filelocation)?

I know some people will say why not just compile this first then run it that way. Well I could but then I'd have to setup differant databases and stuff for that sperate program. Which I'd rather not do just yet.

Thanks for any information.

##### Share on other sites

#2 ·  Posted (edited)

Run(@comspec & " /c  your_vb_project.vbp")
Edited by JdeB

Live for the present,
Dream of the future,
Learn from the past.

##### Share on other sites

maybe i'm not useing it right but htat just seems to create a file that has inside of it when viewed with a text editor the the path in the function.

##### Share on other sites

how would you normally execute the file? if it needs to pass through another file to be executed, include that in the run line, for vbs files you need to have the run line as such:

Run('cscript.exe "script.Vbs"')

dunno what runs a vb app without it being compiled (not being a vb programmer )

"I'm not even supposed to be here today!" -Dante (Hicks)

##### Share on other sites

#5 ·  Posted (edited)

yeah that works. except you have to put the whole location in for some reason

Run('"X:\Program Files\Microsoft Visual Studio\VB81\VB6.EXE" "X:\Projects\FolderX\someprogram.vbp"')

You don't need the exta quotes i use either. just ' x "y" ' like the smart guy used.

' "x " "y " ' works also though.

Thanks man.

Do they actually call people who use VB programmers?!

Edited by Falling

##### Share on other sites

glad to have helped, the single quotes around the double quoted file paths passes the whole kit and caboose to windows exactly as though you'd typed it that way in to the run line... thus taking care of filenames with spaces... if you didn't have filenames with spaces, you wouldn't need the double quotes inside... ' "some path\to some file.exe" "some path to some other file.doc" '

see faq #7 for more about quotes...

"I'm not even supposed to be here today!" -Dante (Hicks)