This content has been marked as final. Show 4 replies
I would presume you would use a UNC path: \\server\directory\file.
Of course any CF running this code would have to running as a user that
has permissions to read this path.
You had pointed me in the right direction regarding the psstools in order to create a batch file that can remotely start and stop services.
i used the psexec command and am able to successfully restart the services needed remotely... however when i pick the file in the coldfusion administrator (in the probes section) how to i point to the batch file to run? it seems like the probe is not running the script like i want... the file is located on the c:\ so i entered c:\test2.bat...
You should review the online help in the cfadmin for probes and the links it points you to in the developer's guide. Basically you need to define a new probe in the cfadmin by clicking the "Define New Probe" button. One of the probe's attributes will be what action. Define the action as a program and point it at a batch file running psexec. You will probably need to run CFMX as a specific user and not as localsystem, which is the default.
here is what i am doing to test it. i created a file called test2.bat which contains the command "del test.txt" (test.txt contains 3 letters abc). i then run a file called test3.cfm with the following code:
then when i look on the d: drive test.txt does not get deleted. i get no coldfusion errors so it appears the bat file runs. when i click and run the bat file manually it does what its supposed to and deletes test.txt file (which is within the same directory as the bat file). so the problem is that the bat file is not doing the commands its supposed to when coldfusion executes it... what do you suppose is wrong? i also followed the link in your previous help and setup a coldfusion user the way it told me to.