Jump to content

Recommended Posts

Posted

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

  • Developers
Posted

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

Posted

I had at first but when that did not work I made it a simple as I could. I will want to build the command using variables when all done.

Posted

No, they are both fs but that was a typo. It must have something to do with the quotes. I can't run it from a batch file either. Do I need multiple quotes when another command processor is launched?

  • Developers
Posted

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

Posted (edited)

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
Posted

JdeB:

Still does not work.

I arrived at my string by changing Run to ClipPut and pasting it into a cmd box. XP is in the Windows directory at this location.

Posted

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)

Posted

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

Posted (edited)

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
Posted (edited)

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...