Sign in to follow this  
Followers 0
the_lord_mephy

Run()

23 posts in this topic

How can I run a program that's in the same directory without the full filepath, I tried doing Run("filename") but that didn't seem to work.


My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites



Ooh Yeah, wow, so easy yet I managed to miss it. Thanks Larry


My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

Well. At least the answer is already in your signature.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

What about is the file is not a exe, bat, com file. I have an mde from M$ access. I would like to essentially start it like you would in a bat file.

thanks

Well. At least the answer is already in your signature.

<{POST_SNAPBACK}>

Edited by fraudh8er

Share this post


Link to post
Share on other sites

Hey fraudh8er,

Check the @ComSpec macro. Also you can make it run Access.exe in the microsoft folder and run the .mde in the same run command...

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

@fraudh8er:

Check the help file or search the forums.

This question has been asked many times.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I did just that,, found a few threads. thanks

but my next quesiton would be why is this not working

Run(@comSpec & "/c start SS34532k.mde","C:\Program Files\Smartpss\",@SW_Maximize)

or this

Run(@comSpec & "/c start C:\Program Files\Smartpss\SS34532k.mde","",@SW_Maximize)

@fraudh8er:

Check the help file or search the forums.

This question has been asked many times.

<{POST_SNAPBACK}>

Edited by fraudh8er

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I did just that,, found  a few threads. thanks

but my next quesiton would be why is this not working

Run(@comSpec & "/c start SS34532k.mde","C:\Program Files\Smartpss\",@SW_Maximize)

or this

Run(@comSpec & "/c start C:\Program Files\Smartpss\SS34532k.mde","",@SW_Maximize)

<{POST_SNAPBACK}>

try:

Run(@comSpec & ' /c start "C:\Program Files\Smartpss\SS34532k.mde"',"",@SW_Maximize)
Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

so I got a dos window with C:\program files\smartpss\filename.mde as the title. and the working dir was the desktop, where i have my au3 file. i will mess around and see what I can do. anything else i could be doing wrong.

try:

Run(@comSpec & ' /c start "C:\Program Files\Smartpss\SS34532k.mde"',"",@SW_Maximize)

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

I checked the FAQ in the help file and it has the information you need...

but my next quesiton would be why is this not working

Run(@comSpec & "/c start SS34532k.mde","C:\Program Files\Smartpss\",@SW_Maximize)

What is it that does not work as expected?

I can guess. The maximize parameter doesn't maximize the Access (or whatever) window.

This should do it:

Run(@comSpec & "/c start "" /MAX SS34532k.mde","C:\Program Files\Smartpss\")
Edited by SlimShady

Share this post


Link to post
Share on other sites

I checked the FAQ in the help file and it has the information you need...

What is it that does not work as expected?

I can guess. The maximize parameter doesn't maximize the Access (or whatever) window.

This should do it:

Run(@comSpec & "/c start "" /MAX SS34532k.mde","C:\Program Files\Smartpss\")

<{POST_SNAPBACK}>

Don't forget the space before the /c and the "" won;t work unless you put the whole string in single quotes:

Run(@comSpec & ' /c start "" /MAX SS34532k.mde',"C:\Program Files\Smartpss\")

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Stupid. I always do it the right way.

I didn't see this one.

Share this post


Link to post
Share on other sites

thanks guys

I am using, Run (@ComSpec & " /c start msaccess C:\Test\ss34532k.mde")

unless what you guys are saying will work better.

all I have to do is compare the time stamps and I will be done.

thanks again, take care guys for know anyway

Stupid. I always do it the right way.

I didn't see this one.

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I completely forgot about cmd :)

Run(@ComSpec & "/c start "& @ScriptDir & "\restart.au3", @SW_HIDE)

=-o

Edit:

For some reason, that doesn't work.

Edited by the_lord_mephy

My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

Don't forget the space before the /c

Share this post


Link to post
Share on other sites

thanks,

Are you the real Slim Shady, i bet you have never gotten that before :)

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

what if my file name or my path to a file name if variable, can i do that or not.

try:

Run(@comSpec & ' /c start "C:\Program Files\Smartpss\SS34532k.mde"',"",@SW_Maximize)

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

what if my file name or my path to a file name if  variable, can i do that or not.

<{POST_SNAPBACK}>

You mean something like:

$Filename="C:\Program Files\Smartpss\SS34532k.mde"
Run(@comSpec & ' /c start "' & Filename & '"')

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

You mean something like:

$Filename="C:\Program Files\Smartpss\SS34532k.mde"
Run(@comSpec & ' /c start "' & Filename & '"')

<{POST_SNAPBACK}>

I bet it won't work as expected and only sets the title of the CMD window to the path.

If that doesn't work, try this

$Filename="C:\Program Files\Smartpss\SS34532k.mde"
Run(@comSpec & ' /c start "" "' & Filename & '"')

Share this post


Link to post
Share on other sites

I just tried that, well i put the $ before the filename. but it did not work. I have the filename coming in frmo a iniread, is that a problem?

You mean something like:

$Filename="C:\Program Files\Smartpss\SS34532k.mde"
Run(@comSpec & ' /c start "' & Filename & '"')

<{POST_SNAPBACK}>

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