What up Sup Forums, I need help in doing a script on windows. The script has to organize photos by year, month, day, hour, minute, second and milisecond. Something like this:
C:/Photos/AAAA/MM/DD/AAAA.MM:DD-HH.MM.SSss
AAAA as year MM as month DD as day HH as hour MM as minute SS as second ss as milisecond
> milliseconds > only two digits wouldn't you need a million (9,999,999) to properly display MILiseconds?
Blake Perez
Upload the dummy file your teacher is making you use and I'll give you the code.
Ethan Torres
No
Leo Edwards
You know the best part about this is that he gave me nothing to do it. Just "Do it. Search it for your own".
David Perry
Alright give me like 30 mins I got you.
Jeremiah Flores
Go full pajeet and copy paste code from Stack Overflow If you still got no idea what to look for to accomplish this task just drop out of whatever the fuck you're studying
Jace Martinez
there's the whole %D %Y %M shit on windows too, isn't there?
Liam Sanchez
You're kidding right?
Samuel Mitchell
>The script has to organize photos by year, month, day, hour, minute, second and milisecond. where are these coming from?
Andrew Jenkins
Here you go I didnt test it but beggars cant be choosers.
Basically a for statement just make sure you play with the time settings if something is off.
Also forgot to add the md makes a files to move your sorted items there.
I did the for method for files just update it to anything you need and play with the sorting.
Jeremiah Baker
So i'm a guy from OP's class, yes, it has to be sorted by metadata, the thing is, that the script needs to sort the pictures you drag into the script, and rename them. Then, move them to the right folder for year, month and day.
Just don't run this from C:\Windows\system32, thank you. Wrap it in a function and put a mandatory path parameter if you want it reusable without running from a prompt/ISE.
Dominic Jenkins
Output of that scriptblock:
PS > Get-ChildItem -Recurse -Include "*.png","*.jpg" | Select-Object -Property Name
As you can see, it's in the desired format. You could make it much safer, as it will simply rename everything, but I gave you what you wanted. Just don't be a moron.
Adam Sanchez
Yeah, it looks perfect, but the problem is that I can't use PowerShell. Only cmd, the only step I made is the command to move files to another folder.
Juan Carter
in cmd: >powershell.exe -executionpolicy unrestricted -file c:\path\to\the\script.ps1
fucking solved you ain't making me use cmd like it's 1999. why "can't" you use powershell anyway?
Bentley Stewart
That's how it works in the real world you non contributing zero.
Austin Price
nvm, just read that it's your fucking homework
well, thanks for keeping my brain alive this thursday evening.
Leo Sanchez
I've been searching for about 15 hours how to make that shit