​
Showing posts with label name. Show all posts
Showing posts with label name. Show all posts

Saturday, 22 July 2017

Copy files and change name with PowerShell

Copy files and change name with PowerShell




A friend of mine asked if I could copy files from one folder to another and rename them according to the following format

YYYYMMDDHHMMSS.ext

here  source code:


 cls 
$source="C: ext72source"
$destination="C: ext72destination"
set-location $source
$files=get-childitem -Recurse
foreach ($file in $files)
{
if (!$file.PsIsContainer)
{
$newName=$destination+""+[string]$file.LastWriteTime.Year +
[string]$file.LastWriteTime.Month +
[string]$file.LastWriteTime.Month +
[string]$file.LastWriteTime.Day +
[string]$file.LastWriteTime.Hour +
[string]$file.LastWriteTime.Minute +
[string]$file.LastWriteTime.Second +
[string]$file.Extension
Copy-Item $file.FullName $newName
}
}

Then change source and destination variable in the script.
{ Read More }


Friday, 9 June 2017

Create Folder Files With No Name!

Create Folder Files With No Name!




1) Select any file/folder
2) Click on rename & press f2
3) Press& hold alt key.
while holding the alt key, type the number 0160 from the numpad

NOTE: No. press from right side numpad of the keyboard & then enter.
{ Read More }


Wednesday, 19 April 2017

Create Folders And Files With NO! Name

Create Folders And Files With NO! Name


This trick will allow you to create files and folders without any name.

Just follow the steps as given below :-

1) Select any file or folder.

2) Right click on it, select Rename or simply press F2.

3) Press and hold the Alt key. While holding the Alt key, type numbers 0160 from the numpad.

Note :- Type the numbers 0160 from the numpad, that is, the numbers present on the right side of the keyboard.
Don�t type the numbers which are present on top of the character keys.

4) Press Enter and the nameless file or folder will be created.

Reason :- The file or folder that seems nameless is actually named with a single space.



But what if you want to create another nameless file or folder in the same directory ?
For this you will have to rename the file with 2 spaces.
Just follow the steps given below :-

1) Select file, Press F2.

2) Hold Alt key and type 0160 from the numpad.

3) Release the Alt key. Now without doing anything else, again hold Alt key and type 0160.

4) Press Enter and you will have second nameless file in the same directory.

5) Repeat step 3 to create as many nameless files or folders in the same directory.

(We have a problem with deleting these folders, to do so, start your computer in Safe Mode and delete it from there.)
{ Read More }