Sign in to follow this  
Followers 0
condoman

Run Problem

16 posts in this topic

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

Share this post


Link to post
Share on other sites



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


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

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.

Share this post


Link to post
Share on other sites

Sorry did not understand you wanted me to run it.

Same result, clipboard does not contain the output. :D

Share this post


Link to post
Share on other sites

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


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

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?

Share this post


Link to post
Share on other sites

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


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

#9 ·  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

 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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.

Share this post


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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#14 ·  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

Share this post


Link to post
Share on other sites

so, where'd you get the shortcut.exe?


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

Share this post


Link to post
Share on other sites

#16 ·  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

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