how to predict the name of zip folder generated by windows? - vbscript

I am going to prepare a (windows) server side service which allows users to download their requested files as a Zipped folder. In Microsoft windows(7) If you select all files and folders and send them to a zip folder, a random name will be assigned to the generated zip file which is the name of one files or folders in that collection.
Is there any reason that windows doesn't set a new name say new-zip-file? and how can I predict what the name would be?

The name of the zip is in fact not random,
it relies in the file you choose to click at last.
you can select multiple files but you make right click on one only file in order to zip the group of files, and thats the file name windows chooose.

Related

I'm looking to have a Folder recognise new files being saved into it and then copy new files into a collated folder

In MacOS i want a folder action to trigger when i place a new file into a subfolder. The action should grab a newly added file to the folder and copy it to another folder where all the latest files are collated and can be viewed together. I also want the script to delete any old version of the same file it copies across to the collated folder. The trouble is the file names are slightly dfferent as they have a version number in them. The version number is defined as "v01a" to start with but can change to "v01b" or "v01e" or "v02a" or "v03c".
So if a file called "1234_ProjectName_Image01_COMP_v01a.jpg" already exists and a new file called "1234_ProjectName_Image01_COMP_v01b.jpg" is added the the file called "1234_ProjectName_Image01_COMP_v01a.jpg" needs to be deleted from the destination folder.
I've tried a few times to get started in automator but never really get the pieces in place for it to be useful.
(SOURCE)
Dailies/_Internal
Dailies/_Internal/Image01/1234_ProjectName_Image01_COMP_v01a.jpg
Dailies/_Internal/Image02/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Internal/Image03/1234_ProjectName_Image03_COMP_v01a.jpg
(DESTINATION)
Dailies/_Latest
Dailies/_Latest/1234_ProjectName_Image01_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image03_COMP_v01a.jpg
If a new file is added called
Dailies/_Internal/Image01/1234_ProjectName_Image01_COMP_v02a.jpg
then this file is copied from its source folder and put into the Destination folder.
(DESTINATION)
Dailies/_Latest
Dailies/_Latest/1234_ProjectName_Image01_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image01_COMP_v02a.jpg
Dailies/_Latest/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image03_COMP_v01a.jpg
Here there is already an image with the same name except the version number so the script should also delete the old file leaving me with.
(DESTINATION)
Dailies/_Latest
Dailies/_Latest/1234_ProjectName_Image01_COMP_v02a.jpg
Dailies/_Latest/1234_ProjectName_Image02_COMP_v01a.jpg
Dailies/_Latest/1234_ProjectName_Image03_COMP_v01a.jpg
I can't for the life of me figure out how to do this, any ideas would be greatly appreciated.
Screengrab of my very basic automator here

Power Automate - Can't navigate to folder or obtain folder id

this is a general question about Power Automate and OneDrive that I've seen no solution to.
I'm trying to create a flow "Copy files from a folder in OneDrive (Business) to an FTP server". The trigger is "When a filed is created" in a OneDrive directory. When I attempt to navigate to the folder I just see ROOT, then "No Items".
I also can't figure out how to obtain the unique identifier of the folder.
I was able to get the ID of my folders with this short Instant flow.
It'll output a JSON response with the ID, Name, Path, etc for all your folders in the Root of OneDrive. There is also a "List files in folder" block that you can use to get subfolders of folders.
I was able to copy the ID string from the JSON response and paste it into the "When a file is create" OneDrive trigger and have it go off successfully.
The issue was I was attempting to do this using OneDrive(Business) when I should have used Sharepoint based on my organization's license

Automatically checking the existence of folders in a path

I have a lot of folders, each folder has someone's surname as the name. I want to move all these surname folders into a different path, how would I automatically check the path I want to move them to, for the same name.
For example. Let's say in C:/Downloads I have a folder called Nunes. How would I make it so when I upload another folder called nunes, it alerts me that that folder already exists?

Create folder in selected folder with OS X Automator

I am trying to batch convert a bunch of raw image files on OS X. I would like to use built-in software since it is possible.
First I would like to
let the user select the input folder containing the raw files;
create a new folder jpgs inside of that folder;
copy the raw files from the user selected folder into jpgs.
This is the workflow I have implemented so far in order to implement the first two steps.
First I let the user select a folder and store it into the variable NEF Folder. The I create a new folder named jpgs in the folder chosen by the user (NEF Folder).
BUT this is what the workflow does after selecting folder AAA on the Desktop:
Why?
Understood.
The action New folder creates a folder and copies its input inside of the newly created folder.
I have the same issue and solved it checking the box "Ignore this action's input".

How can I determine which folder the user was browsing when my program was invoked from the "sent to" menu?

I put a shortcut to my application in SendTo. Now I can select some files in Explorer and send them to my application. But how can I get the path where the files are? My program is supposed to create a new file in the parent directory that's common to all the received file names.
For example, if I have these files:
C:\one.txt
C:\1\
I select the file one.txt and the directory 1 in Explorer. How can I find out that the starting directory for these files is C:\?
I know I can use ParamStr() to get files' paths, but what then?
I could try to get common directory for all the files passed to my application, but if I select in C:\ directories 1 and 2 and these directories look like this:
C:\1\4\5\one.txt
C:\1\4\two.txt
Then the starting directory is C:\1\4.
Prior to Windows 7, all files selected in Explorer always reside in the same directory, so it's easy to know which directory the user was browsing. It's the same as the directory of any one file. Use ExtractFilePath for that.
As of Windows 7, though, Explorer lets you put directories into groups called libraries. All the files from all the folders are displayed together in a single view. Users can select files from multiple directories and send them all to your program at once. The view doesn't represent any real directory on the disk, so the question asked here is meaningless.
As an alternative, you could decide use the ancestor directory common to all the files sent to your program, but that won't tell you much. For one thing, if the files reside on multiple drives, the common directory will be the empty string. The directory you calculate also might not be writable by the current account, even if the directories of one or more of the selected files are.
It will probably be easier to just use the directory of the first file you receive, or even to display a UI that asks the user what directory to use in the cases you can't determine it automatically. (Maybe you could pre-populate the result with the first directory, so the user doesn't have to do anything but approve your suggestion in the common case.)
I think I will just take all the filenames passed to my program via ParamStr and use this function:
http://delphi.about.com/od/delphichallengesexercises/qt/delphi-extract-base-path-challenge.htm
to find common base path which should be the path where the SendTo was invoked.

Resources