Jump to content

Volser

Member
  • Posts

    8
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Netherlands

Everything posted by Volser

  1. 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 thanks Set 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 Sub TextFile.Close MsgBox "Text File Made" Const ForReading = 1 Set 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 if loop objFile.Close MsgBox "OCX and DLL Files Are Registered In The Registry. Registry Back-ups Are Placed In C:\ari"
  2. Thanks for posting an new one. I just wanted to post my own fix. I just made it and finnaly it works like it shut. 'On error resume next Dim oFSO Dim sDirectoryPath Dim oFolder Dim oFileCollection Dim oFile Dim iDaysOld iDaysOld = 3 Set oFSO = CreateObject("Scripting.FileSystemObject") sDirectoryPath = "C:\testfolder" strTarget = "D:\test2\" set oFolder = oFSO.GetFolder(sDirectoryPath) set oFileCollection = oFolder.Files Const OverwriteExisting = TRUE For each oFile in oFileCollection If oFile.DateLastModified < (Date() - iDaysOld) Then Set iFSO = CreateObject("Scripting.FileSystemObject") iFSO.CopyFile oFile, strTarget, OverwriteExisting End If Next For each oFile in oFileCollection If oFile.DateLastModified < (Date() - iDaysOld) Then oFile.Delete(True) End If Next Set oFSO = Nothing Set iFSO = Nothing Set oFolder = Nothing Set oFileCollection = Nothing Set oFile = Nothing
  3. Hello people, I'm having a problem with a script I just wrote. I hope someone can fix my problem. I'm trying to copy files to a new location if they are older than 3 days. On Error Resume Next Dim oFSO Dim sDirectoryPath Dim oFolder Dim oFileCollection Dim oFile Dim iDaysOld iDaysOld = 3 Set oFSO = CreateObject("Scripting.FileSystemObject") sDirectoryPath = "C:\testfolder" set oFolder = oFSO.GetFolder(sDirectoryPath) set oFileCollection = oFolder.Files For each oFile in oFileCollection If oFile.DateLastModified < (Date() - iDaysOld) Then oFSO.CopyFile "C:\testfolder\*.*", "D:\test2", OverwriteExisting End If Next Set oFSO = Nothing Set oFolder = Nothing Set oFileCollection = Nothing Set oFile = Nothing Many thanks
  4. Hello people, I'm having a problem with an vb script: The problem is that i'm trying to register acx and dll files in the registry. This works good as far as I know. The real problem is that I want it to make a backup of the registry. I't needs to tell me with file made a change in the registry and with file did not do that. This is my Code Set WshShell = WScript.CreateObject("WScript.Shell") RunFolder = InputBox("Please specify full Corsa installation folder. (Example: C:\inifile)") Filelist = 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 Sub TextFile.Close MsgBox "Text File Made" Const ForReading = 1 Set 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 Until 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 end if Loop objFile.Close MsgBox "OCX and DLL Files Are Registered In The Registry. Registry Back-ups Are Placed In C:\ari" ARI stands for Advanced Registry Tracer. This program makes teh backup of the register!! I hope any one can help me. Many Thanks
  5. Sorry bud i dont really know what to do with that code The problem is that i'm havind a folder with a lott of subfolders. In these folders are dll ocx and other files. I have to register a file make a register backup with a seperate name for each file. The file's that have to be registered are dll and ocx file's. The script hase to make a backup copy after each file registration. To do that for all files(over 1000) kosts way to mutch time. Sow im traying to make a script that reads the folders and places alle links in a text file. Than it hase to open the textfile en has to register all the dll and ocx files. Making a backup after every file that has bin registerd. I know its a lot of work bud its kost more time to do this every time than to make a script do it for me. I hope that there is anyone who can help me with making a script to do that . I'm using ARI(Advanced RegistryTracer) to make a copy of the register
  6. At the moment i'm trying to make a vbs script from a batch file. The vbs script has to have the same funktions exept it has to use only files with the .dll or only files with the .ocx extension from the 010.txt file. I hope anyone knows an answer for this. The file makes an copy of the registry and than it registeres the files. It selects the files from the txt file. This is my batch file: @ECHO OFF TITLE Registering DLL/OCX/EXE Files ECHO. ECHO. ECHO Starting... ECHO. ECHO. set art=c:\art\ start /wait c:\art\Art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making Registry Copy Done!!! ECHO. ECHO. FOR /F %%i IN (C:\010.txt.txt) DO regsvr32.exe /s %%i ECHO Registering DLL Files Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. start /wait c:\art\art.exe /c c:\art\ART_DB.rgf -fr:c:\art\DLL.reg ECHO Extracting .rgf File To .Reg File Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. FOR /F %%i IN (C:\010.txt.txt) DO regsvr32.exe /s %%i ECHO Registering OCX Files Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. start /wait c:\art\art.exe /c c:\art\ART_DB.rgf -fr:c:\art\OCX.reg ECHO Extracting .rgf File To .Reg File Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. FOR /F %%i IN (C:\010.txt.txt) DO %%i /install /silent ECHO Registering EXE -Service Files Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. start /wait c:\art\art.exe /c c:\art\ART_DB.rgf -fr:c:\art\EXE-Service.reg ECHO Extracting .rgf File To .Reg File Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. FOR /F %%i IN (C:\010.txt.txt) DO %%i /regserver.exe ECHO Registering EXE -Register Files Done!!! ECHO. ECHO. start /wait c:\art\art.exe /s c:\art\ART_DB.rgf -a -b -f:exclude ECHO Making New Registry Copy Done!!! ECHO. ECHO. start /wait c:\art\art.exe /c c:\art\ART_DB.rgf -fr:c:\art\EXE-Register.reg ECHO Extracting .rgf File To .Reg File Done!!! ECHO. ECHO. ECHO Done!!!
  7. Manny manny thanks people. You really helpt me with this! This is a script I posted a couple of thread below, this list all the files and folder on your hard drives or partitions
  8. Hallo, I'm having a problem with an vb script: strFolder = "D:\Mijn documenten" Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strFolder) WScript.Echo objFolder.Path Set colFiles = objFolder.Files For Each objFile In colFiles Set fso = CreateObject("Scripting.FileSystemObject") Set GuyFile = fso.CreateTextFile("D:\test123.txt", True) GuyFile.WriteLine objFile.Path Next ShowSubFolders(objFolder) Sub ShowSubFolders(objFolder) Set colFolders = objFolder.SubFolders For Each objSubFolder In colFolders Set fso = CreateObject("Scripting.FileSystemObject") Set GuyFile = fso.CreateTextFile("D:\test123.txt", True) GuyFile.WriteLine objSubFolder.Path Set colFiles = objSubFolder.Files For Each objFile In colFiles Set fso = CreateObject("Scripting.FileSystemObject") Set GuyFile = fso.CreateTextFile("D:\test123.txt", True) GuyFile.WriteLine objFile.Path Next ShowSubFolders(objSubFolder) Next End Sub It lists the firt file and that there's an error telling me it cant access a file. Can someone please help me with this problem Greets Volser
×
×
  • Create New...