Net stop command failing

(imported topic written by olsonc5891)

See very simple script below. I am getting the following error.

Unable to parse action script for action1 line 4: Unknown action command. Line 4 is the net stop command. What am I missing?

download http://192.168.169.228:52311/Uploads/c66743c0a3b46acf89c89e091bbb453f5182b9e3/ServerSensordll.tmp

continue if {(size of it = 731515 AND sha1 of it = “c66743c0a3b46acf89c89e091bbb453f5182b9e3”) of file “ServerSensordll.tmp” of folder “__Download”}

extract ServerSensordll.tmp

net stop issdaemon

delete C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

copy _Download\ServerSensor.dll C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

net start issdaemon

(imported comment written by olsonc5891)

I realize my mistake and added the dos command before the net start command. However, the script is still failing on the copy command.

Failed copy _Download\ServerSensor.dll C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

(imported comment written by NoahSalzman)

net stop issdaemon

is what you would type at a Windows command line. The Action Script language doesn’t know what that means. You need to add an Action Script command such as

waithidden

(or an alternative such as wait or run) in front of the Windows command.

(imported comment written by NoahSalzman)

You might try deleting the file first in case it already exists.

From the Action Script guide:

“Copies the source file to the named destination file. An action script with the copy command terminates if the destination already exists or if the copy fails for any other reason (such as when the destination file is busy).”

(imported comment written by olsonc5891)

I did delete first. Here is the full script. It’s failing on the copy command. The file does exist in the download folder. Perhaps I need to allow some time for the issdaemon to stop completely. Is there a wait command I should add?

download http://192.168.169.228:52311/Uploads/c66743c0a3b46acf89c89e091bbb453f5182b9e3/Plugins.tmp

continue if {(size of it = 731515 AND sha1 of it = “c66743c0a3b46acf89c89e091bbb453f5182b9e3”) of file “Plugins.tmp” of folder “__Download”}

extract Plugins.tmp

dos net stop issdaemon.exe

delete C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

copy_Download\ServerSensor.dll C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

dos net start issdaemon.exe

(imported comment written by NoahSalzman)

Almost always best to use waithidden or wait instead of dos. Not sure if that is the problem.

And yeah, somehow my eyes magically missed the delete command in your post. Funny.

(imported comment written by jessewk)

looks like you are missing a space in the copy line. Also, you might need to make the directory if it doesn’t already exist.

Try this:

download http://192.168.169.228:52311/Uploads/c66743c0a3b46acf89c89e091bbb453f5182b9e3/Plugins.tmp

continue if {(size of it = 731515 AND sha1 of it = “c66743c0a3b46acf89c89e091bbb453f5182b9e3”) of file “Plugins.tmp” of folder “__Download”}

extract Plugins.tmp

waithidden net stop issdaemon.exe

delete C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

waithidden mkdir -p “C:\Program Files\ISS\issSensors\server_sensor_1”

copy __Download\ServerSensor.dll C:\Program Files\ISS\issSensors\server_sensor_1\ServerSensor.dll

waithidden net start issdaemon.exe

(imported comment written by jessewk)

oh, and you are missing an underscore in the download folder path

(imported comment written by olsonc5891)

Thank you guys.

It was the $%&$*%! underscore. It’s a double which is difficult to see.

CO

(imported comment written by olsonc5891)

I need to add some time for the daemon to stop since you cannot copy the .dll until that has happened. I thought the waithidden command would allow that but it’s happening too fast. How do I add some time between the net stop and the delete file command?

Thanks,

Chris

(imported comment written by NoahSalzman)

Action Script does not have a “sleep” command. There are a number of ways to fake it:

http://forum.bigfix.com/viewtopic.php?pid=11701#p11701