Member Avatar

I am tring to call the same subroutine several times. The first time it runs it works correctly. Everytime after the first time it doesn't run the subroutine in order. I was wondering if anyone knows how to do this. Here is my current script.

@echo off

set description=Disabled %date:~4,2%-%date:~7,2%-%date:~10,4%

set return=next1
set value="Domain Controllers,DC=dtint,DC=com"
GoTO :Program
set return=next2
set value="Computers,DC=dtint,DC=com"
GOTO :Program
set return=next3
set value="Computers,OU=DTI-AU,OU=DTI-Offices,OU=DTI-Admin,DC=dtint,DC=com"
GOTO :Program


dsquery computer ou=%value% -inactive 10 -limit 0 > C:\ComputersDisableSept17-2012.txt

@echo Number of Inactive Computers:

dsquery computer ou=%value% -inactive 10 -limit 0 | find "CN=" /c

@echo Disabling Computers

dsquery computer ou=%value% -inactive 10 -limit 0 | dsmod computer -disabled Yes -desc "%description%"

@echo Moving Computers

for /F "Tokens=*" %%i in (C:\ComputersDisableSept17-2012.txt) do dsmove %%i -newparent OU=ToBePurged,OU=DTI-Admin,DC=dtint,DC=com

GOTO %return%



Member Avatar

I had a bad path in the code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.