How can I delete a file with extension ".." in 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 7 years ago.
Improve this question
I mistakenly created a large file on a windows drive mounted in a linux using touch.
touch /mnt/<my_win_drive>/my_super_file...
Notice that the file extension is in ".."
I am using windows 7 but I assume it should be the same for all windows versions.
Now I can easily remove it from linux:
rm /mnt/<my_win_drive>/my_super_file...
But if I try to remove it from explorer then it fails miserably saying that he cannot find the file:
Could not find this item
This is no longer located in <my_win_drive>
Verify the item's location and try again.
If I try using cmd, it's all the same:
cd <my_win_drive>
rm my_super_file... (note that tab-autocomplete works)
rm: cannot lstat `my_super_file...': No such file or directory
So what's the big deal if one can delete the file from linux you'd ask.
Well, the problem is that windows explorer allows you to copy such a file.
In my particular case, my_super_file was not created by touch but is actually a 4Gb file that I copied with the wrong name on my shared_drive, then on my desktop.
Now I a am stuck with a large file that I cannot move from my desktop.
Any idea how to get rid of it other than formatting my drive?

Two options:
Use the \\?\ syntax which will bypass the usual file parsing rules:
del "\\?\c:\pathtoyour\file..."
Capture the legacy 8.3 name with dir path /x then delete:
del "file~id"

Related

W10 CMD forfiles [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 2 years ago.
Improve this question
Since I had a task where I have to copy recursively files of a nested directory for work, i discovered the forfiles-function in windows cmd.
It worked properly and now I wonder how does the function distinguish between a file and a directory?
If every file had a file extension like .jpg .png .xls or something like that, I could understand it, but some of my files came without extensions, but it still did its job.
As I'm used to linux, I tried to google the sourcecode, but windows applications aren't opensource, so if anybody can explain me, how does it work, it would be very interesting to know.
PS: why does this got downvoted? its a general question
The command will eventually call the Windows FindFirstFile/FindNextFile functions. Those return a WIN32_FIND_DATA structure which may contain a FILE_ATTRIBUTE_DIRECTORY flag. If that flag is not set, it's a file.
Internally there is quite a difference between a file and a directory, and it's no surprise that typical file/directory handling commands know about this. The fact that a file doesn't have an extension (or that a directory is called "directory.jpeg") does not cause any confusion within those commands.
If you check forfiles' "man page" (forfiles /?), you might see that the /C switch gives you access to the #isdir variable, which can tell you the difference: are you dealing with a directory (value:TRUE) or a file (value:FALSE)?

System cannot find the directory of current running process in “C:\Windows\Fonts” folder [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 4 years ago.
Improve this question
I have a file running from this directory:
C:\Windows\Fonts\com4.{208d2c60-3aea-1069-a2d7-08002b30309d}, When I want to open that directory it says System cannot find the specified path and when I want to delete the file inside that folder with PowerShell, it says Access Denied!
How can I delete the file and folder?
COM4 is a special reserved 'DOS Device' name. Files or Folders with these types of names can not be created or accessed by normal means. Also the appended string .{208d2c60-3aea-1069-a2d7-08002b30309d} is the Shell CLSID for My Network Places, It will cause the folder with this appended sting to appear as such in Windows Explorer to hide the contents.
It can be renamed to a normal name so it can be be accessed afterwards. But since it is located in the system folder C:\Windows\Fonts, Administrative rights are needed for doing so.
In an elevated Command Prompt (CMD.EXE) this command can be used to rename the folder
ren "\\.\C:\Windows\Fonts\com4.{208d2c60-3aea-1069-a2d7-08002b30309d}" "NewName"
But for the rename to be successful, any program(Most probably a malware as you mentioned) that is running from this folder must be terminated beforehand.
A malware can have other protections mechanisms to prevent you from doing any of the above actions or easily undo what you have done, So you should protect your system with an updated Antivirus product and keep it updated until it is detected and removed completely.

shared drive cannot run .exe file while using windows 7 [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 have a application called MARN.EXE which stores in a shared drive and works fine on our Windows XP system.
However since we use Windows7, we cannot run this EXE file. error is
Can't run 16-bit Windows program
Cannot find file {filepath\MARN.EXE} (or one of it's components). Check to ensure the path and filename are correct and that all required libraries are available.
I'm sure I have the Full Control to that shared drive folder.
and if I copy this folder to my local laptop, it runs fine. So seems not Windows7 problem.
Does anyone know what's the issue? Thank you.
(In properties
Target: "X:\Cusdfhr Cweihe\CS 1 Svc100\Psqw\MARN.EXE" PDAS.MDB
Start in: "X:\Cusdfhr Cweihe\CS 1 Svc100\Psqw"
)
The problem is the path. Old 16-bit programs actually run on Win7 BUT there are some restrictions to the folder names. Removing spaces, dashes, etc. should do the trick. Just replace whitespaces with _ and don't use long folder names.

hidden autosave file error: no such file or directory [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 6 years ago.
Improve this question
I was editing an emacs file abc, and prior to saving, had a crash. There is now a file .#abc, and I would like to find out what is in that file, to perhaps recover what I was working on.
I know the file is there because when I type
ls -a
it lists
.#abc
However, when I type
more ".#abc"
or simply
more .#abc
I get the error
.#abc: No such file or directory
The same error occurs with cp in place of more.
How do I see what is in that file? Why does ls list it and then other commands can't find the file?
(Is .#abc actually an alias file? If so, how would I know that? And how, nevertheless, do I see the content of it, even if this is only what it is an alias to?)
[Note: I do not want to use emacs to try to find out what is in the file or restore it, because the situation is somewhat more complicated than described: the above is all occurring inside a Time Machine backup, which I need to access because of an emacs autosave overwrite problem on the primary file. I don't want to have the same problem occur on the backup of the autosave file!]
This is all on Mac OS10.8.4.
Whereas autosave files use a tilde ~, lock-files use a dot number-sign .#:
http://www.gnu.org/software/emacs/manual/html_node/elisp/File-Locks.html
Creation of lock-files can be disabled with the following setting:
(setq create-lockfiles nil)
https://stackoverflow.com/a/12974060/2112489

Syncing dot files with dropbox [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 9 years ago.
Improve this question
I puts all my dotfiles in $HOME/Dropbox/dotfiles
and make a hard link(I think it's the way to go, and for instance vim does't load soft link rc file)
ln $HOME/Dropbox/dotfiles/.vimrc $HOME/.vimrc
The problem is as long as I make change to the file in the dropbox directories, everything works as expected. But when I change the hard link file(which is $HOME/.vimrc), the original file changes accordingly, but dropbox won't sync!!(same as iCloud mobile document folder)
Any idea?
Use soft links. Hard links make it so that Dropbox can't tell when the file is updated. This is because Dropbox doesn't poll the contents of every single file you have, it just looks at modification dates on the files located in your Dropbox.
This is exactly what I use for syncing my dot files with Dropbox:
$ ln -s ~/Dropbox/dotfiles/.vimrc .vimrc
and vim still loads the soft-linked vimrc file.

Resources