Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: VSS automation strange problem

by cormanaz (Deacon)
on Jan 04, 2017 at 17:01 UTC ( [id://1178943]=note: print w/replies, xml ) Need Help??


in reply to Re: VSS automation strange problem
in thread VSS automation strange problem

Alas, no help. This
#!/usr/bin/perl -w use strict; use Cwd; chdir('C:\Program Files (x86)\Microsoft Visual SourceSafe'); print cwd()."\n\n"; $ENV{SSDIR} = 'C:\Program Files (x86)\Microsoft Visual SourceSafe'; my $env = `echo %SSDIR%`; print "\n$env\n"; my $cmd = "ss.exe Dir \"\$/\" -Yadmin"; print "$cmd\n\n"; my $result = `$cmd`; print $result;
yields output
C:/Program Files (x86)/Microsoft Visual SourceSafe C:\Program Files (x86)\Microsoft Visual SourceSafe ss.exe Dir "$/" -Yadmin No VSS database (srcsafe.ini) found. Set the SSDIR environment variab +le to the path of srcsafe.ini for your VSS database.
"I think computers have complicated lives very bigly. The whole age of, you know, computer has made it where nobody knows exactly what's going on." --D. Trump

Replies are listed 'Best First'.
Re^3: VSS automation strange problem
by Lotus1 (Vicar) on Jan 04, 2017 at 19:44 UTC

    I just tried the code below and it worked. One thing to check is to be sure you're setting SSDIR to where your srcsafe.ini file is located. From the SS GUI you can click the File pulldown menu and in VSS 6.0 anyway it will show you the path to the srcsafe.ini file just above the 'Exit' command.

    #!/usr/bin/perl use warnings; use strict; my $sspath= 'C:\Program Files (x86)\Microsoft Visual Studio\VSS\win32' +; $ENV{SSDIR}="\\\\server\\path-to-ini"; #or local path #my $cmd = "\"$sspath\\ss.exe\" Dir "; # listed files in defaul +t project my $cmd = "\"$sspath\\ss.exe\" Dir \"\$/\""; # listed subproject fold +ers print "\n********************\n\$cmd=$cmd\n"; system $cmd;

    Update: Although you might be providing the path to an ini file already, since you have installed a new version you might have multiple srcsafe.ini files. By checking the path in the GUI you can verify you are using the correct one.

      Sooo....I had put the SSDIR in environment vars via the advanced settings but that didn't fix it. But after a reboot it finally works. Gotta love windoze! Thanks everybody for all the help!
      "I think computers have complicated lives very greatly. The whole age of you know computer has made it where nobody knows exactly what's going on." --D. Trump Indeed.
Re^3: VSS automation strange problem
by Corion (Patriarch) on Jan 04, 2017 at 17:11 UTC

    At least according to the internet, setting the environment variable doesn't always work.

    Have you compared the environment variables that are set when you manually run the command from the command prompt and what %ENV contains?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1178943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2024-04-18 06:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found