Downloading of files frm VSS using commandline issue.
Hi people,
I got a problem which I don't know if its a VSS or C# problem. Currently i am writing a script which will extract source codes to a local folder. So to achieve 'automation' I created a simple .bat file which contains the ss.exe paths and arguments which will be called by my running C# program.
However the issuse arise when i call the .bat file from my C# program, the sourcecodes are saved to the /bin/debug folder of my C# script. However when i double clicked the .bat file in its own folder, it downloads correctly to the location where the .bat file is.
Below is a directory listing of the above issue
/AutomatedVSSDownloadScript/bin/debug/AutomatedVSSDownloadScript.exe
/MyFolders/getSourceCode.bat
if i invoke the getSourceCode.bat directly using cmd prompt. it works fine.However if i invoke from AutomatedVSSDownloadScript.exe, it downloads to /AutomatedVSSDownloadScript/bin/debug/
currently i am using the Process object to call the .bat file in the AutomatedVSSDownloadScript.exe through its start method.
[1049 byte] By [
bmann225] at [2007-12-17]
Hi,
It seems to me that your getSourceCode.bat invokes "ss.exe Get" without specifying any of the -G flags.
If no flag or -GF- is specified, VSS gets the file in the current folder.
If -GF is specified, VSS gets the file in the working folder (of the file's parent project).
You can get the file in a specified folder by using the -GLpath flag.I suspect you don't pass any of the -G flags. That means that when you run the batch file from command prompt the file gets into the folder you run getSourceCode.bat from, and when you run AutomatedVSSDownloadScript.exe which invokes getSourceCode.bat the file is got in /AutomatedVSSDownloadScript/bin/debug/ (which is the current folder when AutomatedVSSDownloadScript is run)
What you probably need to use in your getSourceCode.bat is something like 'ss Get -GL"%~dp0" $/project/file' if you want the file to always be downloaded into /MyFolders/ folder, or use 'ss Get -GF $/project/file' if you want the file to be downloaded in the current working folder.
Alin
Hi Alin !
Thanks for replying. With regards to the -GF option. so can i specify a working folder to download the files to ? similar to this ?
SS.EXE get $/MyProjects/AccountsManagement -GF D:\Projects\AccountsManagement -R-W-YmyID,password123 ?
the above command will download the files to D:\Projects\AccountManagementFolder on my local machine ?
wilson
Hi Wilson,No, you cannot specify the working folder with the -GF flag.
See the help at
http://msdn.microsoft.com/library/en-us/guides/html/vsgrfss_get.asp
http://msdn.microsoft.com/library/en-us/guides/html/vsgrfcmdline_switchg.asp
for ss get options.You can however set the working folder before doing the get command, like this:
mkdir D:\Projects\AccountsManagement
ss.exe workfold $/MyProjects/AccountsManagement D:\Projects\AccountsManagement
ss.exe get * -GF -R -I- -W -YmyID,password123
Or, if you don't want to alter the working folder for $/MyProjects/AccountsManagement, you can simply use something like:
mkdir D:\Projects\AccountsManagement
ss.exe get $/MyProjects/AccountsManagement -GLD:\Projects\AccountsManagement -R -I- -W -YmyID,password123
Alin