Hi to both of you,
I found a comfortable solution:
- copy the ff. vbscript to your disk e.g. c:\ue_kill_open_files_from_prj.vbs
- make a shortcut to it in your Windows SendTo folder (see Mofis windows explorer settings if you can't find it in e.g. "C:\Documents and Settings\YOURUSERNAME\SendTo"
now when you see the open Project Window and you see your prj, just before double-clicking and opening it, press right mouse and choose "send to ue_kill_open_files_from_prj.vbs".
Your open-files will be removed from the prj-file
then double click or press open for opening it like before.
NO WARRANTY ! Make a backup of your prj file before trying.
rds Bego
- Code: Select all
Option Explicit
'ue_kill_open_files_from_prj.vbs
'deletes all entries with "open file" lines, so that when opening prj, no files are shown
Dim fso
Dim objFile
'Dim objTextStream
Dim fileName
Dim args
dim newLines()
dim i
dim j
dim strLine
set args = WScript.Arguments
if (args.Count <> 1) Then
MeldungRaus "Wrong arguments"
End If
fileName = args(0)
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFile = fso.OpenTextFile(fileName)
i = 0
Do while not objFile.AtEndOfStream
strLine = objFile.ReadLine()
'collect olny lines without "open file" inside
if (InStr(1,strLine, "open file", 1) = 0 and InStr(1,strLine, "Active File", 1) = 0 ) then
i = i + 1
redim preserve newLines(i)
newLines(i) = strLine
end if
Loop
objFile.Close
'now write back the stuff without filtered lines
Set objFile = fso.OpenTextFile(fileName,2, true)
for j = 1 to i
objFile.write newLines(j) & vbcrlf
'msgbox (newLines(j))
next
objFile.Close
wscript.quit
Sub MeldungRaus (strMeld)
wscript.echo strMeld
wscript.quit 1
End Sub