Volser Posted April 12, 2006 Share Posted April 12, 2006 (edited) Hello people,I made this script and I'ts not working like it should do.Can any one help me fix this problem.I'm not getting any output when i run this script. The only message I get is "Text File Made"Manny manny thanksSet WshShell = WScript.CreateObject("WScript.Shell") RunFolder = "C:\test123"'InputBox("Please specify full Corsa installation folder. (Example: C:\test123)")Filelist = "C:\Textfile.txt"'Inputbox("Please specify text file name and destination dir. (Example: C:\Textfile.txt)")strFolder = RunFolder Set Fso = CreateObject("Scripting.FileSystemObject") Set objFolder = Fso.GetFolder(strFolder) Set colFiles = objFolder.Files Set TextFile = Fso.CreateTextFile(Filelist) For Each objFile In colFiles TextFile.WriteLine objFile.Path Next ShowSubFolders(objFolder) Sub ShowSubFolders(objFolder) Set colFolders = objFolder.SubFolders For Each objSubFolder In colFolders TextFile.WriteLine objSubFolder.Path Set colFiles = objSubFolder.Files For Each objFile In colFiles TextFile.WriteLine objFile.Path Next ShowSubFolders(objSubFolder) Next End SubTextFile.CloseMsgBox "Text File Made"Const ForReading = 1Set objFSO = CreateObject("Scripting.FileSystemObject")Set objFile = objFSO.OpenTextFile(Filelist, ForReading)Set objShell = WScript.CreateObject("WScript.Shell") objShell.Run("c:\art\Art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude")Do while not objFile.AtEndOfLine strLine = objFile.ReadLine i = 1 Extension = Right(strLine,i) Do While (not (Left(Extension, 1) = ".")) and (i <= 5) Extension = Right(strLine, i) i = i + 1 loop Extension = UCase(Extension) if (Extension = ".OCX") or (Extension = ".DLL") then i = 1 FileName = Right(strLine, i) do while (not (left(strLine, 1) = "\")) FileName = Right(strLine, i) i = i + 1 loop FileName = Right(strLine, i - 1) FileName = Left(strLine, i - 5) objShell.Run("regsvr32.exe /s " & strLine), 1, True objShell.Run("c:\art\Art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude") objShell.Run("c:\art\art.exe /c c:\art\ART_DB.rgf -fr:c:\art\" & FileName & ".reg"), 1, True else if (Extension = ".EXE") then i = 1 Filename = Right(strLine, i) Do while (not (left(strLine, 1) = "\")) FileName = Right(strLine,i) i = i +1 loop FileName = Right(strLine, i -1) FileName = Left(strLine, i -5) objShell.Run(strLine & "/REGSERVER"), 1, True objShell.Run("c:\art\Art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude") objShell.Run("c:\art\art.exe /c c:\art\ART_DB.rgf -fr:c:\art\" & FileName & ".reg"), 1, True end if end ifloopobjFile.CloseMsgBox "OCX and DLL Files Are Registered In The Registry. Registry Back-ups Are Placed In C:\ari" Edited April 12, 2006 by Volser Link to comment Share on other sites More sharing options...
gunsmokingman Posted April 12, 2006 Share Posted April 12, 2006 Perhaps you should use Dim for you varibles.Dim RunFolder, Filelist, strFolder Link to comment Share on other sites More sharing options...
RogueSpear Posted April 12, 2006 Share Posted April 12, 2006 FileName = Right(strLine, i - 1)FileName = Left(strLine, i - 5)You have these two lines consecutive, which will pretty much make the first line useless. I'm not 100% sure what this script is trying to acheive other than I see it's using Elcomsoft's excellent registry change utility. The script itself I have to say, and I mean no offense if you wrote it, is terribly disorganized and doesn't follow good practices in many regards. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now