Jump to content

Run Problem


Recommended Posts

If I paste the following command into a cmd box it runs successfully, however when I try to run it in au3 with Run() it does not give any output to the clipboard.

Can anyone offer an idea what to try next?

C:\WINDOWS\system32\cmd.exe /c "C:\fss Documents\AutoIt\shortcut.exe" /a:q /f:"C:\Documents and Settings\fsmith\Start Menu\AU3\edit.lnk" | "C:\fs Documents\AutoIt\cb.exe"

Thanks :D

Link to comment
Share on other sites

  • Developers

How did you code it in the Run statement ?

Something like:

Run(@comspec & ' /c "C:\fss Documents\AutoIt\shortcut.exe" /a:q /f:"C:\Documents and Settings\fsmith\Start Menu\AU3\edit.lnk" | "C:\fs Documents\AutoIt\cb.exe"')

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

  • Developers

Is it correct that the directories are different for Shortcut.exe and CB.exe ?

C:\fss Documents\AutoIt\shortcut.exe

C:\fs Documents\AutoIt\cb.exe

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

  • Developers

What about this way:

Run(@comspec & ' /c "C:\fss Documents\AutoIt\shortcut.exe" /a:q /f:"C:\Documents and Settings\fsmith\Start Menu\AU3\edit.lnk" | cb.exe"',"C:\fs Documents\AutoIt")

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

i highly dought this might work like this... C:\WINDOWS\system32\cmd.exe /c """C:\fs Documents\AutoIt\shortcut.exe""" /a:q /f:"""C:\Documents and Settings\fsmith\Start Menu\AU3\edit.lnk""" | """C:\fs Documents\AutoIt\cb.exe"""

if you are using windows nt, 2000 or xp. isn't windows installed into a directory called winnt? just curious... maybe that is the reason why it did not work from bat. because you are calling a directory that does not exist?

Edited by beerman
Link to comment
Share on other sites

it's all about the quotes, if you want to do it with variables, how about this:

run(@comspec & ' /c "' & $AppWithSpaces & '" /opt "' & $fileWithSpaces & '"'
that way, the info that's passed to the cmd prompt has quotes around anything that might have spaces or funny characters.

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

Link to comment
Share on other sites

Sorry for not responding I was on my way home.

Holger:

I want to read a .LNK to determine the properties. It seemed like shortcut.exe was a good solution.

emmanuel:

After a break I am back experimenting. I sure this will work once the syntax is figured out.

Thanks

Link to comment
Share on other sites

Here is what finally worked. Some file names changed because I am at home now.

$A = @comspec & ' /c ' &  FileGetShortName ( @ScriptDir & "\Shortcut.exe" ) & ' /A:Q /F:"C:\Documents and Settings\U\Start Menu\z\AU3\edit.lnk" |cb.exe' 
Run($A)

The reason for this is to validate critical settings for a software installation. I wanted to be able to read and report on the settings in a shortcut.

Thanks for all the replies. :D

Edited by condoman
Link to comment
Share on other sites

I had to surf some to find a copy on the web. I'll find a place to put shortcut.exe for all to have. Here is what the output looks like.

[C:\Documents and Settings\fsmith\Start Menu\AU3\edit.lnk]TargetPath=C:\Program Files\AutoIt3\SciTe\SciTE.exe

TargetPathExpanded=C:\Program Files\AutoIt3\SciTe\SciTE.exe

Arguments=

ArgumentsExpanded=

WorkingDirectory=C:\fs Documents\AutoIt\

WorkingDirectoryExpanded=C:\fs Documents\AutoIt\

RunStyle=1

IconLocation=,0

IconLocationExpanded=,0

HotKey=0 (None)

Description=

The command completed successfully.

I put shortcut.exe in the publuic folder area under the condoman folder. Edited by condoman
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...