Friday, October 25, 2013

Unshelve shelveset created from one branch to another


Unshelve shelveset created from one branch to another

When you need to unshelve to a different branchTFS power tool will help… 

The power tool command /> tfpt.exe unshelve can be handy for the following,
·         Allows a shelveset to be unshelved into a workspace with pending changes.
·         Merges content between local and shelved changes.
·         Allows migration of shelved changes from one branch into another by rewriting server paths.
·         Allows changes from an already-unshelved shelveset to be undone, cleaning up pending adds, and preserving other existing pending changes in the workspace.


Below is a list of features that are installed with the March 2011 Power tool installation.

Once the installation is complete, go to the cmd and type />tfpt.exe

we are interested in />tfpt unshelve to achieve unshelving of a shelve set to a different branch

Syntax
/>tfpt unshelve [shelvesetname[;username]] [/nobackup]
                     [/migrate /source:serverpath /target:serverpath]
shelvesetname          The name of the shelveset to unshelve
/nobackup              Skip the creation of a backup shelveset
/migrate               Rewrite the server paths of the shelved items
                        (for example to unshelve into another branch)
/source:serverpath     Source location for path rewrite (supply with /migrate)
/target:serverpath     Target location for path rewrite (supply with /migrate)
/undo                  Undo pending changes from an unshelved shelveset
/batchsize:num         Set the batch size for server calls (default 500)

Sample
/> tfpt unshelve “MySampleShelveNamel;AD\username” /migrate /source:”$/MyTeamProject/TheOrigionalBranch” /target:”TheDestinationBranch”
Catches
If you get the error => "unable to determine the workspace"

NOTE: Take the latest from your source control and “cd” to a local path that is mapped to the target workspace. Also ensure that the current working directory is mapped, you can run "tf workspace" and see if the target folders are mapped. 

Saturday, October 19, 2013

Files on flash drive changed to shortcut

Hi All,

Recently I had to deal with some type of virus, computer virus J. Usually I don’t have such problems, cause I am IT professional, but my parents do. J The problem with this virus took so much time (all my saturday evening) that I decided to write about these hours of fight, maybe this info saves someone’s time using my experience. 
My father called and said, that he could not open some critical Excel file on USB flash drive. I found some information on this site.

It wasn't problem with flash itself, but it seemed to me that it was a virus.
I had made the following steps:

FIRST STEP

If you did not format your flash drive, then check whether the files are in hidden mode. Then follow these steps:
·         Click on the link below and download the file "AutorunExterminator":
·         Extract it: Double-click on "AutorunExterminator"
·         Plug your pendrive now
·         This will remove the autorun.inf files from your pendrive and also from the drives
·         Click on Start > Run, type cmd and click OK
·         Here it is assumed your pendrive letter is G (change as necessary)
·         Enter this command.
·         attrib -h -r -s /s /d g:\*.*     
·         Press Enter
·         Now check for your files in on the pen drive
·         Now download the Malwarebytes' Anti-Malware from this link:http://en.kioskea.net/download/download-105-malwarebytes-anti-malware
·         Update it and perform a "Full Scan"
·         Note : The default selected option is "Quick Scan"

Here is some nice video: 

It helped me to clean virus from usb, but not to open the file with name  „Рарх>ды.xls”. It seemed that the virus somehow changed the file name with illegal character „>”

When I cliked on file I got a following message:

I used a different approaches, but could not rename the file name. After hours of searching internet, I found out info that files contain short names and can be read by using cmd command DIR /X
Here is this information with a link.

In Windows Command Shell with Short Filenames
The DOS command DIR/X shows short filenames, if they exist on your system.
$ cmd
c:\test> dir /x
 Volume in drive E is NUVOL
 Volume Serial Number is 80D3-A96D

 Directory of e:\tor\test

10/04/2009  05:15 AM    <DIR>                       .
10/04/2009  05:15 AM    <DIR>                       ..
10/04/2009  05:11 AM                 0 CLIP-2~1.MOV clip-2009-10-01 21;26;00.mov
               1 File(s)              0 bytes
               2 Dir(s)   5,201,670,144 bytes free
If they do exist, the REN command will move them to a new name; the new name can be a new (valid) long filename.
c:\test> ren CLIP-2~1.MOV "clip-2009-10-01_21-26-00.mov"
That's how to fix one.
To batch process all of them, you need to 1) grab the short filenames of all the files you want to move; 2) convert your listing into a batch file with the appropriate REN commands; and 3) run the resulting batch script. If you are comfortable with perl (or sed/awk, python, whatever), you can script this yourself, or you can craft it by hand from the listing you made in step 1.
But if DIR/X doesn't show the short filenames, your system has them disabled, and this solution won't help.


SECOND STEP
So I went to USB drive to the directory (using command prompt) to the file location, ran commnad DIR /X to get short filename.
My file short name was „DBF1~1.XLS„ 
H:\data>dir /x
 Volume in drive H has no label.
 Volume Serial Number is 105C-D911
 Directory of H:\data
2013.04.29.  08:07    <DIR>                       .
2013.04.29.  08:07    <DIR>                       ..
2013.10.14.  21:40           186 368 DBF1~1.XLS   Рарх>ды.xls

Then I ran the command H:\data>ren DBF1~1.XLS test.xls

FINAL STEP

And I can open the file.
My father was happy J
Good luck