carfan Posted January 12, 2008 Share Posted January 12, 2008 now i am running hard coded DirCopy('x:\Programs\Hijackthis', 'b:\Hijackthis') Run('x:Programs\Runscanner\runscanner.exe /cp /q b:\Hijackthis\hijackthis.exe') but i want to change x:\ and b:\ to drive variables but i just cant get a grasp of it. can anyone help me please??? Thanks -c Link to comment Share on other sites More sharing options...
BrettF Posted January 12, 2008 Share Posted January 12, 2008 $drive = "x:\" Run ($drive & "Programs\....") Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
carfan Posted January 12, 2008 Author Share Posted January 12, 2008 $drive = "x:\"Run ($drive & "Programs\....")thanks - what about b:\ (which is also ramdrive) and which is also TempDir-c Link to comment Share on other sites More sharing options...
BrettF Posted January 12, 2008 Share Posted January 12, 2008 Didn't study it very much did you? Look up Variables in the helpfile. Look at operators. Now, what is the variable equal to? X:\, so if you change the value of the variable... Mmmmhhhhmmmm? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
carfan Posted January 12, 2008 Author Share Posted January 12, 2008 $drive = "x:\"Run ($drive & "Programs\....")ok - ive changed my script to incude the variable and the copy portion works however, my runscanner does not. here's what does work$temp = "b:\"$drive = "x:\"DirCopy('$drive & Programs\Hijackthis', '$temp & Hijackthis', 1)Run('x:\Programs\Runscanner\runscanner.exe /cp /q b:\Hijackthis\Hijackthis.exe') but, iwant to change x:\ and b:\ to my variables. i'm not punctuating it properly i guess. ive triedRun('$drive & Programs\Runscanner\runscanner.exe /cp /q $temp & Hijackthis\Hijackthis.exe')but it doesnt pass syntax check. /cp and /q are necessary switches for runscanner.exeany ideas???-c Link to comment Share on other sites More sharing options...
Brickoneer Posted January 12, 2008 Share Posted January 12, 2008 It looks like you put the variable inside the string, so it is looking for "$drive&programs...." Try playing around with this: Run($drive & 'Programs\Runscanner\runscanner.exe /cp /q' & $temp & 'Hijackthis\Hijackthis.exe') Link to comment Share on other sites More sharing options...
martin Posted January 12, 2008 Share Posted January 12, 2008 ok - ive changed my script to incude the variable and the copy portion works however, my runscanner does not. here's what does work$temp = "b:\"$drive = "x:\"DirCopy('$drive & Programs\Hijackthis', '$temp & Hijackthis', 1)Run('x:\Programs\Runscanner\runscanner.exe /cp /q b:\Hijackthis\Hijackthis.exe') but, iwant to change x:\ and b:\ to my variables. i'm not punctuating it properly i guess. ive triedRun('$drive & Programs\Runscanner\runscanner.exe /cp /q $temp & Hijackthis\Hijackthis.exe')but it doesnt pass syntax check. /cp and /q are necessary switches for runscanner.exeany ideas???-cYou need to have a look at what Bert told you; he has already given you the answer but you have not done what he said. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
carfan Posted January 12, 2008 Author Share Posted January 12, 2008 It looks like you put the variable inside the string, so it is looking for "$drive&programs...."Try playing around with this:Run($drive & 'Programs\Runscanner\runscanner.exe /cp /q' & $temp & 'Hijackthis\Hijackthis.exe')this works:Run($drive & "Programs\Runscanner\runscanner.exe /cp /q b:\Hijackthis\Hijackthis.exe")but i still need to get rid of the "b:\" and replace with "$temp &". the problem is that the statement:"runscanner.exe /cp /q b:\Hijackthis\hijackthis.exe" is all one long statement. when the %temp & is substituted,the command line is broken because of the spaces. (i think). ive tried multiple brackets to isolate the entire statementfrom beginning to end but i either get a syntax error or the command line stops in the middle of the command due to it cant find the executable file. runscanner loads the registry, waits for the load and then runs an executable where everit has been directed to. so, the statement runscanner.exe with switches /cp and /q needs to continue unbroken to source exedir\executable to finish. ex: runscanner.exe /cp /q drive\dir\exe i.m lost for now. any ideas??? -c Link to comment Share on other sites More sharing options...
martin Posted January 12, 2008 Share Posted January 12, 2008 this works:Run($drive & "Programs\Runscanner\runscanner.exe /cp /q b:\Hijackthis\Hijackthis.exe")but i still need to get rid of the "b:\" and replace with "$temp &". the problem is that the statement:"runscanner.exe /cp /q b:\Hijackthis\hijackthis.exe" is all one long statement. when the %temp & is substituted,the command line is broken because of the spaces. (i think). ive tried multiple brackets to isolate the entire statementfrom beginning to end but i either get a syntax error or the command line stops in the middle of the command due to it cant find the executable file. runscanner loads the registry, waits for the load and then runs an executable where everit has been directed to. so, the statement runscanner.exe with switches /cp and /q needs to continue unbroken to source exedir\executable to finish. ex: runscanner.exe /cp /q drive\dir\exe i.m lost for now. any ideas??? -cAre you saying that you have tried the line given by BrickoneerRun($drive & 'Programs\Runscanner\runscanner.exe /cp /q' & $temp & 'Hijackthis\Hijackthis.exe')and that it doesn't work when $temp = 'B:\'?At the moment I'm a bit confused about why you seem to reply to a suggestion with a problem that doesn't appear to use what was suggested. If you tried what was suggested and it doesn't work you need to make that clear. If you haven't tried what was suggested could you say why not? Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Bowmore Posted January 13, 2008 Share Posted January 13, 2008 Are you saying that you have tried the line given by Brickoneer Run($drive & 'Programs\Runscanner\runscanner.exe /cp /q' & $temp & 'Hijackthis\Hijackthis.exe') and that it doesn't work when $temp = 'B:\'? At the moment I'm a bit confused about why you seem to reply to a suggestion with a problem that doesn't appear to use what was suggested. If you tried what was suggested and it doesn't work you need to make that clear. If you haven't tried what was suggested could you say why not?It probably needs a space after /q' to make it work. e.g \q ' Run($drive & 'Programs\Runscanner\runscanner.exe /cp /q ' & $temp & 'Hijackthis\Hijackthis.exe') "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
carfan Posted January 13, 2008 Author Share Posted January 13, 2008 (edited) Are you saying that you have tried the line given by BrickoneerRun($drive & 'Programs\Runscanner\runscanner.exe /cp /q' & $temp & 'Hijackthis\Hijackthis.exe')and that it doesn't work when $temp = 'B:\'?At the moment I'm a bit confused about why you seem to reply to a suggestion with a problem that doesn't appear to use what was suggested. If you tried what was suggested and it doesn't work you need to make that clear. If you haven't tried what was suggested could you say why not?yes, i copied and pasted what was suggested. from the subsquent failure message i derived the conclusion that the command linemust be continous. Edited January 13, 2008 by carfan Link to comment Share on other sites More sharing options...
martin Posted January 13, 2008 Share Posted January 13, 2008 yes, i copied and pasted what was suggested. from the subsquent failure message i derived the conclusion that the command linemust be continous.I think Bowmore had the answer, I hadn't noticed that a space was missing. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. 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