A.B.Ames Posted December 4, 2004 Share Posted December 4, 2004 (edited) Hi all,2 sample lines that may help those new here.90% of you don't need this but I would like to post it for those that, like me are new and having headaches getting it to work. The manual covers basic quote use but I found using with variables and switches difficult. Online searching had lots of info for quotes but couldn't find any that seemed to cover these situations exactly. So after trial and error I got these to work, hopefully this will help out other newbies.If you just want to run this in command line:hlscan /dir "E:\_TEMP\HL test" /logthe path is the variable and here is a sample that worked:$hlscanCmd = RunWait(@COMSPEC & ' /c hlscan /dir "' & $SearchPath & '" /log',"",@SW_HIDE)(corrected thx to Saunders reply -ABA)write a line to batch file rd /s /q "C:\Documents and Settings\JohnDoe"JohnDoe is the Variableand here is a sample that worked:FileWriteLine($VarBatch, 'rd /s /q "C:\Documents and Settings\' & $VarUser & '"')If any errors please let me know, else - hope this helps someoneThx A.B.Ames Edited December 6, 2004 by A.B.Ames Link to comment Share on other sites More sharing options...
therks Posted December 4, 2004 Share Posted December 4, 2004 (edited) Why start a string with the double quotes at all?$hlscanCmd = RunWait(@COMSPEC & " /c" & 'hlscan /dir "' & $VarPath & '" /log',"",@SW_HIDE)To$hlscanCmd = RunWait(@COMSPEC & ' /c hlscan /dir "' & $VarPath & '" /log',"",@SW_HIDE)Also note, in your first example you didn't put a space between /c and hlscan." /c" & 'hlscan' = /chlscanI don't know that the command line understands that parameter Edited December 4, 2004 by Saunders My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
A.B.Ames Posted December 6, 2004 Author Share Posted December 6, 2004 Hi Saunders, Thx for the corrections they make much better sense, as for why I did it that way i can only answer that I'm learning and don't fully understand it all yet. The examples of Quotes in the manual only deal with text and I couldn't locate any similar to what i was doing. So I pieced together what i could and then did trial and error till it worked. Infomation I found seemed to be more oriented for those that already know programming and scripting, not much for those that are learning. Also I'm not sure why the code funtions with out a space after /c, again what you showed me same makes far more sense (and i will follow that now). Oddly enough though, I have done dozens of scripts using lines without the space and using many prompt commands (Net User, Net Localgroup, etc.) and they have all worked so i never bothered to change it. again, many thx Take Care A.B.Ames 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