|
-
Oct 11th, 2003, 04:54 PM
#1
Thread Starter
New Member
Shell command problem
I have a window I made to run some of my visual demos. I'm simply unloading that window and running another program from it. The syntax I'm using is:
If RN = 1 Then Myprog = Shell("C:\My Documents\Chris Misc\Progname", 1)
On some PC's this works fine, on others, when running the executable of my program, they get a path error. What can I do different to avoid the error?
vbsslink
-
Oct 11th, 2003, 05:03 PM
#2
You're hardcoding the path, ie: "C:\My Documents\Chris Misc\Progname". On the computers it doesn't work on, the program you're trying to access must have a different path. If it's your program, look into the App.Path statement. Otherwise, you'll have to find a way to get the path of the program you're running.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Oct 11th, 2003, 06:32 PM
#3
Thread Starter
New Member
Shell syntax
The app.path seems to work fine for my record score, but I can't get it to work with the Shell command.
I tried Myprog = Shell("App.Path\Progname", 1)
I compiled it and ran it and got a path error. How can I use App.Path with the Shell command?
-
Oct 11th, 2003, 06:35 PM
#4
Like in the other post, App.Path is a variable, therefore you set it off from the string:
VB Code:
Myprog = Shell(App.Path & "\Progname", 1)
Last edited by jemidiah; Oct 11th, 2003 at 06:50 PM.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
-
Oct 11th, 2003, 06:47 PM
#5
Thread Starter
New Member
app.path in shell command
I tried it the way you last showed it the first time I tried it, but I forgot the '&'.
Works fine.
Thanks again, jemidiah!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|