Renaming the containing project folder in VS.net under TFS

Check in all pending changes within the folder and ensure that all other team members to do the same. Ensure that you have a copy of the folder in your working directory (otherwise, you will not have the option to rename the folder in the Source Control Explorer in the next step). Get latest version … Read more

Find all files in a folder

A lot of these answers won’t actually work, having tried them myself. Give this a go: string filepath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); DirectoryInfo d = new DirectoryInfo(filepath); foreach (var file in d.GetFiles(“*.txt”)) { Directory.Move(file.FullName, filepath + “\\TextFiles\\” + file.Name); } It will move all .txt files on the desktop to the folder TextFiles.

How do you get a directory listing in C?

The following POSIX program will print the names of the files in the current directory: #define _XOPEN_SOURCE 700 #include <stdio.h> #include <sys/types.h> #include <dirent.h> int main (void) { DIR *dp; struct dirent *ep; dp = opendir (“./”); if (dp != NULL) { while ((ep = readdir (dp)) != NULL) puts (ep->d_name); (void) closedir (dp); return … Read more

How to navigate to a different directory in Jupyter Notebook?

Default root of the Jupyter explorer is the current location (folder) where you start the Jupyter server. With the explorer, you can only navigate to all levels of the children folders, but not the parent’s of that location. There is an option to set the root folder –notebook-dir when you start Jupyter. Here is an … Read more

How to get a list of sub-folders and their files, ordered by folder-names

How about using sort? dir /b /s | sort Here’s an example I tested with: dir /s /b /o:gn d:\root0 d:\root0\root1 d:\root0\root1\folderA d:\root0\root1\folderB d:\root0\root1\file00.txt d:\root0\root1\file01.txt d:\root0\root1\folderA\fileA00.txt d:\root0\root1\folderA\fileA01.txt d:\root0\root1\folderB\fileB00.txt d:\root0\root1\folderB\fileB01.txt dir /s /b | sort d:\root0 d:\root0\root1 d:\root0\root1\file00.txt d:\root0\root1\file01.txt d:\root0\root1\folderA d:\root0\root1\folderA\fileA00.txt d:\root0\root1\folderA\fileA01.txt d:\root0\root1\folderB d:\root0\root1\folderB\fileB00.txt d:\root0\root1\folderB\fileB01.txt To just get directories, use the /A:D parameter: dir /a:d /s … Read more

Slashes and the rsync command

It’s described in the rsync(1) manpage: A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning “copy the contents of this directory” as opposed to “copy the directory by name”, but in both cases … Read more

How do I find the current directory of a batch file, and then use it for the path?

There is no need to know where the files are, because when you launch a bat file the working directory is the directory where it was launched (the “master folder”), so if you have this structure: .\mydocuments\folder\mybat.bat .\mydocuments\folder\subfolder\file.txt And the user starts the “mybat.bat”, the working directory is “.\mydocuments\folder”, so you only need to write … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)