Jump to content

i need help with variables


carfan
 Share

Recommended Posts

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

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?

Link to comment
Share on other sites

$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 tried

Run('$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.exe

any ideas???

-c

Link to comment
Share on other sites

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 tried

Run('$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.exe

any ideas???

-c

You 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

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 statement

from 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 ever

it has been directed to. so, the statement runscanner.exe with switches /cp and /q needs to continue unbroken to source exe

dir\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

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 statement

from 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 ever

it has been directed to. so, the statement runscanner.exe with switches /cp and /q needs to continue unbroken to source exe

dir\executable to finish. ex: runscanner.exe /cp /q drive\dir\exe i.m lost for now. any ideas???

-c

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?

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

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

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?

yes, i copied and pasted what was suggested. from the subsquent failure message i derived the conclusion that the command line

must be continous.

Edited by carfan
Link to comment
Share on other sites

yes, i copied and pasted what was suggested. from the subsquent failure message i derived the conclusion that the command line

must 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

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
 Share

  • Recently Browsing   0 members

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