Sign in to follow this  
Followers 0
phatzilla

Problem with "run"

8 posts in this topic

#1 ·  Posted (edited)

Okay i know this is like such a simple command but for some reason something isnt working out

Run("1.exe", @SystemDir & "\Hello" , @SW_MAXIMIZE)

All it's supposed to do is run the file 1.exe @ c:\Windows\system32\hello\1.exe. (The directory exists).

It always tells me it cant find the specified file (The file also exists).

What's up?

Edited by phatzilla

Share this post


Link to post
Share on other sites



Okay i know this is like such a simple command but for some reason something isnt working out

Run("1.exe", @SystemDir & "\Hello" , @SW_MAXIMIZE)

All it's supposed to do is run the file 1.exe @ c:\Windows\system32\hello\1.exe. (The directory exists).

It always tells me it cant find the specified file (The file also exists).

What's up?

Run The Following and you'll see the error of your ways!

MsgBox(0,"Cursor Position:",@SystemDir & "\Hello")

Share this post


Link to post
Share on other sites

still doesnt work even with

Run("1.exe", @SystemDir & "\Hello\" , @SW_MAXIMIZE)

Share this post


Link to post
Share on other sites

Is the file located at \windows\system32? Might want to try:

Run(@SystemDir & "\Hello\1.exe", @SystemDir, @SW_MAXIMIZE)
Thank you that fixed it. But why is the 'filename' refered to as "@SystemDir & "\Hello\1.exe"".

I thought the filename is just that, the name of the file which is 1.exe, i didnt know i had to stick the extra directory in there.

Thanks though.

Share this post


Link to post
Share on other sites

From the Help file....

To run DOS (console) commands, try Run(@ComSpec & " /c " & 'commandName', "", @SW_HIDE)

So for your example, try

Run(@ComSpec & " /c " & @SystemDir & "\Hello\1.exe", "", @SW_MAXIMIZE)

Share this post


Link to post
Share on other sites

still doesnt work even with

Run("1.exe", @SystemDir & "\Hello\" , @SW_MAXIMIZE)

Correct Code Shoud Be:

Run(@SystemDir & "\hello\" & "1.exe","", @SW_MAXIMIZE)

Area after first comma is root dir not path to prog

Share this post


Link to post
Share on other sites

Correct Code Shoud Be:

Run(@SystemDir & "\hello\" & "1.exe","", @SW_MAXIMIZE)

Area after first comma is root dir not path to prog

Mine works fine..... SAG's advice is for COMMANDS....NOT PROGS

Share this post


Link to post
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
Sign in to follow this  
Followers 0