> I got it guys...posted in hurry
> No need to reply ;-)
> "Andy.Net" wrote:
> > I want to move list of computer accounts listed in .txt file to specifid OU
> > I have refered below script from
> >http://www.eggheadcafe.com/aspnet_answers/scriptingVisualBasicscript/...and specify the OU path and .Txt path but getting an error as
> > Line: 79
> > Char:1
> > Error: Expected statement
> > code: 800A0400
> > Source: Microsoft VBScript compilation error
> > ******Script****
> > Option Explicit
> > Dim strFile, strTargetOU, objFSO, objFile, objOU
> > Dim objRootDSE, strDNSDomain, objTrans, strNetBIOSDomain
> > Dim strComputer, strComputerDN, objComputer
> > Const ADS_NAME_INITTYPE_DOMAIN = 1
> > Const ADS_NAME_TYPE_NT4 = 3
> > Const ADS_NAME_TYPE_1179 = 1
> > ' Specify text file of computer NetBIOS names.
> > strFile = "c:\Computers.txt"
> > ' Specify target OU to move computer objects into.
> > strTargetOU = "ou=SrAccounts,dc=MyDomain,dc=com"
> > ' Open the file for read access.
> > Set objFSO = CreateObject("Scripting.FileSystemObject")
> > Set objFile = objFSO.OpenTextFile(strFile, 1)
> > ' Bind to the target OU.
> > Set objOU = GetObject("LDAP://" & strTargetOU)
> > ' Determine DNS domain name from RootDSE object.
> > Set objRootDSE = GetObject("LDAP://RootDSE")
> > strDNSDomain = objRootDSE.Get("DefaultNamingContext")
> > ' Use the NameTranslate object to find the NetBIOS domain name from
> > ' the DNS domain name.
> > Set objTrans = CreateObject("NameTranslate")
> > objTrans.Init ADS_NAME_TYPE_NT4, strDNSDomain
> > objTrans.Set ADS_NAME_TYPE_1179, strDNSDomain
> > strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
> > ' Remove trailing backslash.
> > strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
> > ' Use the NameTranslate object to convert computer NetBIOS
> > ' names to Distinguished Names.
> > objTrans.Init ADS_NAME_INITTYPE_DOMAIN, strNetBIOSDomain
> > ' Read lines from the file.
> > Do Until objFile.AtEndOfStream
> > strComputer = Trim(objFile.ReadLine)
> > If (strComputer <> "") Then
> > ' Convert NetBIOS name to DN.
> > ' NetBIOS name must have "$" appended to end.
> > ' Trap error if computer not found.
> > On Error Resume Next
> > objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain _
> > & "\" & strComputer & "$"
> > If (Err.Number <> 0) Then
> > On Error GoTo0
> > Wscript.Echo "Computer not found: " & strComputer
> > Else
> > On Error GoTo 0
> > strComputerDN = objTrans.Get(ADS_NAME_TYPE_1179)
> > ' Bind to the computer object.
> > Set objComputer = GetObject("LDAP://" & strComputerDN)
> > ' Move the computer object to the target OU.
> > objTargetOU.MoveHere objComputer.AdsPath, vbNullString
> > End If
> > End If
> > Loop
> > Wscript.Echo "Done" - Hide quoted text -
> - Show quoted text -