How do can I redirect the output of soscmd to a log file?
In VSS, you can do something like "ss ... -olog.txt". The output is written to a file named log.txt.
Thanks.
Steve
Redirect Output
Moderator: SourceGear
You can redirect output to a text file by using ">."
For instance, on my machine:
will create a file named clcfile.txt with contents from the output:
C:\Program Files\Microsoft Visual Studio\Common\VSS\srcsafe.ini
C:\VSS Databases\_test\srcsafe.ini
C:\VSS Databases\MyDB\srcsafe.ini
For instance, on my machine:
Code: Select all
soscmd -command getdatabases -server myserver:8080 > C:\_sos\clcfile.txt
C:\Program Files\Microsoft Visual Studio\Common\VSS\srcsafe.ini
C:\VSS Databases\_test\srcsafe.ini
C:\VSS Databases\MyDB\srcsafe.ini
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager
-
- Posts: 15
- Joined: Thu Nov 03, 2005 8:51 pm
Linda,
I have an automated script that labels, extracts, etc. from VSS. When I execute the soscmd through cscript, the redirection does not work.
Example.
Dim WSHShell
Dim cmd
Dim JobStatus
Set WshShell = WScript.CreateObject("WScript.Shell")
cmd = "soscmd -command GetProject " & SOS_CONNECTIONSTRING & " -project """ & SSafeProj & """ -label "& AssemblyVersion & " > """ & LatestBuild & "\SSafeOut_Get.txt"""
WScript.Echo cmd
JobStatus = WSHShell.Run (cmd, 1, true)
WScript.Echo "rc=" & JobStatus & vbCRLF
The command does execute but the redirection does not work.
Thoughts?
Steve
I have an automated script that labels, extracts, etc. from VSS. When I execute the soscmd through cscript, the redirection does not work.
Example.
Dim WSHShell
Dim cmd
Dim JobStatus
Set WshShell = WScript.CreateObject("WScript.Shell")
cmd = "soscmd -command GetProject " & SOS_CONNECTIONSTRING & " -project """ & SSafeProj & """ -label "& AssemblyVersion & " > """ & LatestBuild & "\SSafeOut_Get.txt"""
WScript.Echo cmd
JobStatus = WSHShell.Run (cmd, 1, true)
WScript.Echo "rc=" & JobStatus & vbCRLF
The command does execute but the redirection does not work.
Thoughts?
Steve
We don't see anything glaringly wrong . . . I assume all your variables are correct? Is the file created, but it's empty? Or is there no file?
Does it make a difference if you explicitly specify the path to the file?
What if you redirect the output of Cscript, rather than the CLC?
Does it make a difference if you explicitly specify the path to the file?
What if you redirect the output of Cscript, rather than the CLC?
Linda Bauer
SourceGear
Technical Support Manager
SourceGear
Technical Support Manager