I am trying to take the PID output of the tasklist command and send it to the taskkill command. I have successfully createed a FOR loop to go through the values of the tasklist command and echo out the PID of the process. Mstsc.exe is used as just an example process to kill.
for /F "tokens=2...
I am trying to take the PID output of the tasklist command and send it to the taskkill command. I have successfully createed a FOR loop to go through the values of the tasklist command and echo out the PID of the process. Mstsc.exe is used as just an example process to kill.
for /F "tokens=2...
I wanted to let you know that you were right with the environmental variables. I assumed %systemroot% was the environmental variable, but it was %windir%. I swapped that out and defined the variable correctly. It works now just as it should. I thought %systemroot% is by default a environmental...
I see what you mean about the variable not being defined correctly. But do you see anything indicating why it wouldn't work with the complete path "c:\windows\etc...." instead of using the variable?
Definately should've turned off on error resume next. I have made the changes. However, I can't get the script to recognize that the folder exists. I have removed the strWinDir and just tested it with c:\windows\etc..., but that doesn't work either. Any suggestions why it isn't recognizing the...
I made the addition you suggested, but aren't able to get the script to run successfully. I have also removed
%systemroot% and put in c:\Windows...... but had no luck with that either. I have another script which you have commented on, about defragging a disk. It uses environmental variables...
I have a script here to test for a folder's existence. If found pop up a message to show that it exists. In the long run it will run a command to uninstall the update if found. Right now I am trying to have it just locate the file and verify that is working, but I haven't had any luck. I have...
Thanks for the help. I am still having a bit of trouble with it. I used the inStr function and added the additional spaces at the end of the file. If I kept the Wscript.Echo in to pop up a message to say yes or no, it stayed in a constant loop saying "no" until I killed the wscript.exe. So I can...
I have a script that I have created to test a drive to see if it has to be defragged. I am able to run the defrag to analyze the disk without an issue. I would like to then read the text file output to see if the drive must be defragged. The file that is output contains the correct string I am...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.