Robocopy a specific folder - robocopy

We use a folder template for our projects we work on and my normal process to log each job is to right click, copy, rename, make shortcuts, etc... It's like a 5 minute process after everything is said and done. For right now the idea is to just copy that template folder, rename, make shortcuts, and send those shortcuts to the appropriate directories. This issue I'm having is that when I run robocopy it is copying the contents and not the template directory itself. A snippet of what I have right now is:
robocopy \\Users\blah\blah\DirectoryIWantToCopy \\Users\blah\blah\CopiedDirectory /e
As of right now when I run it, it is copying everything inside the directory instead of just copying the parent directory. I understand why it's doing it, but it seems as though the only way to accomplish what I'm doing is to exclude all the directories inside \Users\blah\blah\ that I don't want it to copy. Is there not a switch to add that just says copy this specific directory and all sub directories of this specific directory? I'm sure that is as simple as it sounds, and I'm sure I'm overlooking it, but from all the other questions I've googled I haven't been able to find an answer that answers this.

So when I read the information about the switches on Technet it kept referencing a file, and thought that only meant an actual file and not a directory. I got it to work by simply adding the file name after the destination. Thanks.

Related

PowerShell - actions over files in folders and subfolders

So basically, there is a tab in a website containing thousands of .pdf files. It's a list with folders of which some of them have subfolders. Obviously, these folders/subfolders contain the files. In order to download the files, I need to open each and every folder, right click on every single file and click download. Is there a way to automate this recursively with PowerShell for all the files? Or maybe UiPath?
If you are unable to access the server files directly, so not through the website but through Windows Explorer then that would probably rule out, or at least make it quite trick to use power shell.
However this is something that UiPath should be able to cope with quite easily. Several automation's I have worked on do a similar thing.
Essentially the automation would need to do the following
login
enter search terms
for each returned folder
for each file in folder
Download file
for each folder in folder
repeat above
Essentially you need to build a recursive loop to loop through all of the folders and files, downloading a file when you encounter one

How can I search for a file in just one specific folder in VSCode when using a workspace with multiple folders?

I'm using the workspace feature of VSCode, with two projects, but it's annoying to search for a file in the front-end project and need to pass by back-end files to find the one I want.
I'm using ctrl + p to search for files.
How can I search for a file in just one folder with multiple projects opened in the workspace?
Yes thats possible: use a relative path: ./mySearchedProjectName in "files to include"-input
from HERE!
UPDATED answer to UPDATED question
The fuzzy file finder (CTRL+P or ⌘+P) somehow supports prefixing the filename with a folder, such as folder/filename to locate a file from a specific folder:
But, in my experience, the search is a bit lacking. For example, I find it usually can only find files this way if that file has been recently opened in your workspace. It also does not support regex.
The best thing that can be done is to enable including recently opened files by adding this to the workspace settings:
"settings": {
"search.quickOpen.includeHistory": true,
AFAIK, there is no other built-in way to filter the results. There are (still) open feature requests for this, like this Allow quick open to filter on folder names by typing folder name after the file. You can thumbs-up them to hopefully get them noticed.
ORIGINAL answer to ORIGINAL question
I don't know what you mean by "projects" since VS Code only has "workspaces" and "folders", such that you add folders to a workspace. I think you're already doing this, where each folder contains a separate set of codes.
With that said, the Search/Find panel has an area to specify files to include, where you can limit your search to a specific folder. For example:
Here I have 3 folders (proj 1-3) added to a workspace. I have 3 sample files with the same text.
When searching, you can set files to include to a specific folder (./proj2), so that the search results will be limited to that folder.
I've found the best solution to this for me (though it's still a sub-optimal one) is simply to run multiple VS Code instances, one for each folder.
It's a pain to start up, but once you get things going (and hopefully you're not restarting often on your dev machine, so this is less of an issue) it works perfectly: you can search for files with only the relevant ones showing up.
Also, if you want to reduce the start-up pain you can make a shortcut/alias/etc. in your operating system that starts both at once.

Correct way to copy Swift project without altering old project?

I was wondering if there was a correct way to make a copy of a Swift project?
I realised that when I want to make a copy of a project (so that I can have a backup working copy when I continue with my project and I make a mistake) and I use that copy; the copy alters the build folder of my original file. Not only that but if I re-name classes or change IBLabels/IBOutlets, and although the change isn't reflected in the original code; when I compile the original file there will an error associated to an undefined class or the xib file would be changed which would also throw an error. At the start the original file compiled, but after working on the copy of the original file and running into an error. The original file also wouldn't compile, any ideas on why this happens? And how to fix it?
Though #Daij-Djan's answer is correct you need to watch for added files with relative paths. So what I do for a backup is to use git. That works better than any backup.
If you really want a copy, just copy the folder with the project with CMD-D which creates a <folder> Copy (or whatever is your localization). You can rename the copy, but leave the contents untouched. Also do leave it in the same folder as the original one to avoid conflicts with relative paths.
Just copy the whole folder from a to b!
IF you used absolute paths in your xcode project though .. bad for you :/ your project references the original files no matter what
what you can try is fixing the project.pbxproj xml file manually. this is doable but not supported by xcode really :/
IMHO if a copy isn't enough because you messed up the project with absolute paths, readd all files MANUALLY and make sure all is relative to the project location
Just zip your current project & extract it inside your new project folder & enjoy....

Can I search Netbeans' local history?

In one of the previous versions of one of my file in a Netbeans project I wrote code that I later removed, and now I want to retrieve it. However now I can't find it when I manually go to previous versions, as I have many versions in the local history of this file, and I don;t remember when exactly I wrote this code.
Is there a way to run a search on the local history of this file?
I saw in this answer that the local history is kept in this path
<HOME>/.netbeans/<NB_VERSION>/var/filehistory where HOME is my user home and NB_VERSION is the version of NetBeans (e.g. 7.0).
I tried running AgentRansack on that directory, but to no avail.
I recently had to solve this problem and figured it out. Netbeans stores local history files in your user directory as mentioned above. Inside that folder are numbered directories. It's pretty easy to guess which one you need based on the modification date of the folder (if you know when you last looked at it, so that doesn't help you much). In side the numbered folders is another folder with a hashed name, and inside of that folder is a set of files: a data file, and numbered files. The data file can be read with a binary file reader, and if viewed in ascii mode will show the filename that this history belongs to. The numbered files are actually zip files and they have full versions of the file in them. Just unzip those and open with a text editor if they are plain text files.
Hope this helps you out, but I realize its probably too late now. I had to figure this out because I had opened a remote file with netbeans (a file that was not associated with a project), and couldn't get back into the Local History because the file didn't have a project. However I could see it in the Local history by reading the data file, and I just guessed that the other files were zipped by the fact that they started with "PK" in the binary viewer. Once I put it all together I was home free.

Back and Rollback Script for a File Transfer

I looking for a good solution to backup and rollback a folder using the Windows(XP/Vista/7) OS.
As an example, say, I have a folder, called "\SOMEOTHERPC\Destination" (that contains files and subfolders). I wish to take a back up of this folder to my local disk. Then, say I was to edit or delete some of the content of this "\SOMEOTHERPC\Destination" folder and the afterwards rollback the folder to its previous state.
What's the best way to go about this. I am thinking of writing a PowerShell script? Perhaps there is a better way. Any suggestions appreciated?
Thanks.
RoboCopy seems to do the trick requiring just a couple of lines of script.