Robocopy Crashed trying to delete very long(1000+) subfolders WINDOWS [closed] - windows

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I'm using the robocopy command
robocopy empty_dir super_subfoldered_folder /s /mir
rmdir empty_dir
rmdir super_subfoldered_folder
to delete the folders at once but during this command robocopy.exe stops working.
I have tried to delete from a path that starts at least 50 sub folders inside the main folder still crashes.
I've tried renaming them to "1" but windows doesn't let me past 100+ folders and there are at least 1000 more. Tried to create new partition- subst j: . rename some folders and delete the partition but this takes forever because of their number.
Tried dir /x and del the shortened name -> doesnt work.
Is there another way to delete those folders ?

File path in Windows goes through several layers before it gets to the actual file system driver. As a result there are two limits. 1) MAX_PATH (260) limitation introduced by the top-level API 2) 32K actually used by the file system. Since you already have that path, it is obviously within the limits of the file system. Try using path by adding "\\?\" to the front. This is an indicator that Win32 API should not parse the string but pass it directly to the file system (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx). This will only work if the proces making the call is Unicode and 64-bit (on a 64-bit system). Otherwise the string must be converted and/or marshaled and you are back to the 260 limit.

Windows has a subdirectory depth limit and it's not very deep.
You may get a better result by booting up a Live Linux distro on cd or USB, like Ubuntu, and using the GUI file manager to delete the tree.

Related

System Storage Taking Up Way Too Much Space in macOS Mojave [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 10 months ago.
Improve this question
My mac is sending me the frequent alert of low disk space. When I am checking the system storage then it's showing 170+gb is occupied by the system. I am not sure where is my space is getting used?
I tried a few cleaner tools also but couldn't get help much.
Please help to resolve it?
After doing research over various forums of mac's and StackExchange I figured out that it's mostly because of the following reasons.
Log files (Might be crash log files/docker files)
Your email messages stored in outlook (in my case it was almost ~20 GB)
Logs related to cores when a system restarts (~ 10 GB)
Docker Images (This had ~70 GB in my case).
Your nonsystem documents/downloads/itunes
So the question is how to find what all things are unnecessary and safe to delete? These system files are not visible directly.
I tried using a few tools like cleanmymac etc but all were paid so I couldn't get help much there.
To clean up your non-system unnecessary files, you can directly take the help of the storage management tool of mac. You just have to click on optimize storage and it will show all the non-system files.
To cleanup unnecessary system files, use below command
sudo find -x / -type f -size +10G
This command will give you all the files occupying more than 10 GB. You can analyze the files and delete them as necessary.
The highlighted cores are nothing but the state files of your mac to reboot from last state when your mac restarts so it's safe to delete.
Next step is to delete a hidden tmp folder
It will show the size as 0 bytes because your user won't have permission to read it. But will be occupying a hell amount of space. So delete it by giving root permission.
Now, Look if there are any docker images present in your system. Clean them all (Docker.raw).
Using all these steps I was able to clean almost 100+ GB.
Recently found that this issue was caused by a memory leak in one of the Java applications I was running. I had to start the Activity Monitor, searching for Java processes and Force Quit them. Rinse and repeat every time my space runs out. Also fix your code where you can to get rid of memory leaks.

Is there a Windows command to close a file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have opened a file through on Windows command prompt, just by navigating to that directory and then typing it's name. Now is there a way to close that (open) file through the command prompt? I've been searching around and I can't find out how. Seems to be a pretty simple command to not exist.
There is no MS-DOS in Windows and has not been since about 2003. The "Command Prompt" program (named cmd.exe) runs in a console window and looks and behaves like the command interpreter of MS-DOS, enough like it to seem the same to many people, although there are some small differences.
If you give a filename as a command to a command prompt and that named file is not a program, it looks at the extension to try to select an appropriate program to run and open the file. The .doc extension usually corresponds to MS Word (Office) or the stripped-down version MS Works, but depending on what software you have installed and how it is configured .doc could be something else. You can find out what it is on your system by the command-prompt commands assoc .doc and usually then ftype (value from assoc) or by looking in the registry under HKEY_CLASSES_ROOT. Once the program runs (a running program is also called a process) it may keep the file open while running (like Word) or only open it briefly and then close it (like notepad).
Once you know what program/process is running, you can direct that process to stop with the taskkill command. Type taskkill /? for help information. If there is more than one process running the same program and you use the /im option, it will stop all of them, not just the one you want. To use the /pid option, tasklist or TaskManager can help you find the right process -- but if you use TaskManager it can also stop the process, so taskkill is unnecessary. If the program malfunctions and doesn't stop when directed, taskkill /f will force it, but this may leave the open file(s) with damaged and incorrect or unusable data.
Also note that command itself effectively keeps the directory open. If you are trying to rename or move a subtree of files including that directory, you must first either cd the command process somewhere else, or terminate it with exit.

Why this occur about hidden files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I've found 2 hidden files on my drive D:/ , I found them by accident, because one day I opened a picture (1 picture exactly on my drive D:/), and by accident I push right navigation button on keyboard, and there is another picture WHICH familiar with me, and there is another, okay maybe this is not important but this is the name (1. AlbumArtSmall.jpg, 2. Folder.jpg), okay I think these 2 jpg files is hidden, but when I unhidden by the step : Tools > Folder Options > View > Show hidden files and folders, but It doesn't make sense (there is no such file on D:/), after that I check it again by command prompt, which is the step :
1. %drive% d:
2. D:> dir
3. there is no such file (those 2 jpg file)
But, when I check with cygwin terminal as I know this is for Linux OS (my OS is windows7 by the way :
1. /cygdrive/d
2. $ dir
3. there is such file (those 2 jpg file)
I know this is not a big problem, but I'm curious why this is happened? And if I want to delete these 2 files, I can do nothing, maybe there is a way to delete them by cygwin terminal command, but the problem for me not because I want to delete them, but more for why this is occur?
Thanks in advance, sorry for my English.
They are probably hidden and system. You can display them in explorer by selecting, in addition to "show hidden files", the "show system files" option.
On the command line, dir /a will show you hidden and system files, too. To delete them from the command line, type attrib -h -s -r *.jpg to remove hidden, system, and readonly attributes from all jpg files (for example). Then just normal del file.jpg.
Cygwin does not recognize windows-like hidden files (thus showing you them), because in Linux hidden files are marked with a leading point. If you use a windows shell on "unix-"hidden files, you will see them, too, but cygwin should not.
For deletion: Afaik you can make them visible and then simply delete them.
Command prompt won't show hidden files if you execute dir. If you want to see these hidden files, then use dir /a.

How are windows programs installed? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
This looks like a common question. But I was not able to find answer for it. When we try to install windows programs, what exactly happens? What files are copied where? What is written in the registry?
Most programs come with an installation program named Setup.exe or Install.exe. When you install a program, the installation program usually does the following:
Looks for a previous version of the program on your hard disk. If it
finds a previous version, the program may ask whether you want to
replace the previous version.
Creates a folder in which to store the program files. Most
installation programs ask where you'd like this folder. Some
installation programs also create additional folders within this
folder. Windows creates a folder named Program Files, usually in C:\
(if Windows is stored in a partition or drive other than C, the
Program Files folder is usually in the same partition). We recommend
you install all your programs in folders within the Program Files
folder.
note Some software vendors have the bad habit of installing
application programs in locations other than your Program Files
folder. You can't do much about this; the additional folders may
clutter up your root folder, but they don't do any harm.
Copies the files onto your hard disk. If the program files are
compressed, the installation program uncompresses them. Usually, the
installation program copies most of the files into the program's
folder, but it may also put some files into your C:\Windows,
C:\Windows\System, or other folders.
Checks your system for the files and hardware it needs to run. For
example, an Internet connection program might check for a modem.
Adds entries to the Windows Registry to tell Windows which types of
files the program works with, which files the program is stored in,
and other information about the program.
Adds a command for the program to your Start | All Programs menu
(some programs add submenus to the Start | All Programs menu to
contain several commands). The installation program may also add a
shortcut to your Windows desktop to make running the program easy for
you. You can change the position on the Start menu of the command for
the program, get rid of the command, or create a command if the
installation program doesn't make one. You can also create a shortcut
icon on the desktop, if the installation program hasn't done so, or
move or delete the program's shortcut.
Asks you a series of questions to configure the program for your
system. The program may ask you to type additional information, like
Internet addresses, passwords, or software license numbers. It may
also ask which users should be able to run the program.
Every installation program is different, because it comes with the application program, not with Windows. If your computer is connected to a LAN or to the Internet, the installation program may configure your program to connect to other computers on the network.

Curiosity about executing binary [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
This is just a curiosity of mine about how a specific OS executes a binary file.
If I change dir to some path in UNIX or Windows I can execute a program just by entering its file name. In Linux I have to enter ./file_name (unless it's included in PATH). In know it's kind of a stupid question, but is there any reason for that?
Nothing magical - it's simply because, by default, Windows implicitly includes '.' in the executable search path. *nix does not.
The latter behavior is obviously more secure, if marginally less convenient.
You can obtain behavior similar to Windows under *nix (at some cost in security) by adding '.' to your path
For example, you could add the following to your .bash_profile:
export PATH=PATH:.
Of course, that's not exactly the same as Windows, as Windows (again, by default) looks in the CWD first. You could do the same in *nix by moving the '.' to the front of the system's PATH, but don't do that!
It opens you up to a large security risk. If someone were to be able to drop a malicious program with the same name as a system utility (say "ls", or "cp"), that program would run instead of the system utility. You can imagine the potential for "mischief" that provides!
To expand on what Gregj said, there is a PATH variable in both Windows and Linux, which tells the operating system where to look for executables when you don't tell it explicitly where it is. Linux doesn't include the current directory (.) for security concerns; a program could otherwise hide an executable with the name of a common utility (ls, for instance) in a lot of files so you might overlook it, and then it would be run instead of the utility you meant, potentially causing damage, loss of sensitive data, etc. Windows does search ., even if it's not explicitly in the path, for convenience and because of their lack of concern over security.

Resources