condoman Posted June 28, 2004 Share Posted June 28, 2004 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2004 Developers Share Posted June 28, 2004 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 More sharing options...
condoman Posted June 28, 2004 Author Share Posted June 28, 2004 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. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2004 Developers Share Posted June 28, 2004 (edited) And ? Did the code i posted work ? Edited June 28, 2004 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 More sharing options...
condoman Posted June 28, 2004 Author Share Posted June 28, 2004 Sorry did not understand you wanted me to run it. Same result, clipboard does not contain the output. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2004 Developers Share Posted June 28, 2004 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 More sharing options...
condoman Posted June 28, 2004 Author Share Posted June 28, 2004 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? Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2004 Developers Share Posted June 28, 2004 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 More sharing options...
Somerset Posted June 28, 2004 Share Posted June 28, 2004 (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 June 28, 2004 by beerman Link to comment Share on other sites More sharing options...
condoman Posted June 28, 2004 Author Share Posted June 28, 2004 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. Link to comment Share on other sites More sharing options...
Holger Posted June 28, 2004 Share Posted June 28, 2004 @condoman: what you exactly wanna to do? I ask you cause there's an internal Autoit3-command "FileCreateShortcut" to create shortcuts. Take a look into the helpfile Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
emmanuel Posted June 28, 2004 Share Posted June 28, 2004 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 More sharing options...
condoman Posted June 28, 2004 Author Share Posted June 28, 2004 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 More sharing options...
condoman Posted June 28, 2004 Author Share Posted June 28, 2004 (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. Edited June 28, 2004 by condoman Link to comment Share on other sites More sharing options...
emmanuel Posted June 29, 2004 Share Posted June 29, 2004 so, where'd you get the shortcut.exe? "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
condoman Posted June 29, 2004 Author Share Posted June 29, 2004 (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 June 29, 2004 by condoman Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now