Jump to content

Newbie Questions: Can You Run Visual Basic Files?


Recommended Posts

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.

Link to comment
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 :D )

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

Link to comment
Share on other sites

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
Link to comment
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)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...