Jump to content

Run()


Recommended Posts

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]
Link to comment
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]
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Developers

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\")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

Link to comment
Share on other sites

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]
Link to comment
Share on other sites

  • Developers

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 & '"')

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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 & '"')
Link to comment
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}>

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...