Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple File Listing from VSS

Status
Not open for further replies.

TopDog129

Programmer
Feb 10, 2004
1
0
0
GB
Hi,

I am urgently trying to get a file listing from a VSS database in the simple format:

$/My Project/File1.txt
$/My Project/File2.txt
$/My Project/File3.txt
$/My Project/File4.txt
$/My Project/File5.txt
$/My Second Project/File1.txt
$/My Second Project/File2.txt
$/My Second Project/File3.txt
$/My Second Project/File4.txt
$/My Second Project/File5.txt

But cannot do this simple thing. The command line utility and the report have the output of the form:
$/My Project:
File1.txt
File2.txt
File3.txt
File4.txt
File5.txt

$/My Second Project:
File1.txt
File2.txt
File3.txt
File4.txt
File5.txt

Is there ANY utility/script I can run which will give me a directory listing
like the one above?

Any help would be great.

Thanks,

TD
 
TopDog129 - you can use a simple vb script to accomplish the task:

1) run the first command via a batch file
"your path to vss\SS" dir $/EDI -NL -R -oc:\VSS_Prod_Directory_Listing_All.txt -Yuserid,password

(the above should all be on one line.)

2) Copy the following vbs code into a text file, and name it with a .vbs extension. save it, and then double-click on it.

vbs code:
Option Explicit
dim VSSInputFile, VSSFileName, VSSLogAppend, VSSLog, FSO, VSSPath, sLine

Const ForReading = 1, ForWriting = 2, ForAppending = 8
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Set FSO = CreateObject("Scripting.FileSystemObject")

If FSO.FileExists("c:\OutputFile.txt") Then
Set VSSLog = fso.getfile("c:\OutputFile.txt")
Set VSSLogAppend = VSSLog.OpenAsTextStream(ForAppending, TristateUseDefault)
Else
Set VSSLogAppend = fso.createtextfile("c:\OutputFile.txt")
VSSLogAppend.close
Set VSSLog = fso.getfile("c:\OutputFile.txt")
Set VSSLogAppend = VSSLog.OpenAsTextStream(ForAppending, TristateUseDefault)
End If

If FSO.FileExists("c:\VSS_Prod_Directory_Listing.txt") Then
set VSSInputFile = FSO.OpenTextFile("c:\VSS_Prod_Directory_Listing.txt")
While Not VSSInputFile.AtEndOfStream
sLine = VSSInputFile.ReadLine
If Mid(sLine, 1, 5) = "$/EDI" Then 'my project is EDI -- yours may be different
VSSPath = Mid(sline, 1, Len(sline)-1) & "/"
Else
If InStr(sLine, "No items") > 0 Then
Else
If Mid(sLine, 1, 1) = "$" Then
Else
If Trim(sLine) <> "" Then
VSSFileName = Trim(sLine)
VSSLogAppend.WriteLine VSSPath & VSSFileName
'you can add other processing here as needed
End If
End If
End If
End If
wend
End if
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top