Link to home
Start Free TrialLog in
Avatar of Doodad Boy
Doodad BoyFlag for Malaysia

asked on

batch file result for multiple server

I had built a batch file to get result on stand alone server as per below and i getting result as per expected.

How may i run the same command for remote server from a text file

@echo off
cd\
bcdedit | find "Nointegritychecks"
pause
ASKER CERTIFIED SOLUTION
Avatar of NVIT
NVIT
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Doodad Boy

ASKER

does the computer list should be in the same path with the script located
Anywhere you want. Just adjust the FNHosts value to point to it.
i had placed the script, psexec and computer list text file at c:\temp, when i ran the batch file, i don see any output
It doesn't show on the screen.
Instead, results are sent to the files results.txt and details.txt, or whatever you named those files.
Open those files to see.

both files results.txt and details.txt  are empty
Hi NVIT, i found the result.testing currently
Hi NVIT, i found the result showing "failure", but when i check manually the i got result - "nointegritychecks Yes"
Hi NVIT, i think i found the issue, i edited the name in small letters "nointegritychecks", i got success result
Yes. I missed that in the code. To fix, change code to this. It tells it to ignore upper or lower case

find /i "Nointegritychecks"

Open in new window


cool, that fix the upper case / lower case issue. meanwhile any way to run this command in cmd with administrator.
manually we use to right click the cmd and select run as administrator
Create a shortcut to the cmd file then modify the properties, Advanced > checkbox Run as Administrator.

When you run the shortcut you may or may not get the UAC prompt, depending on your UAC settings