How to copy filename with tilde in Windows 7? - windows

I have a DVD which should be burnt in year 2009. In a directory there are 2 files. File-1 is named abc~1.TXT with size 512 KB. File-2 is named abcdefg.txt with size 43 KB.
Now using Win7, when I try to copy file-1 to my hard-disk, it will actually copy the data content of file-2. The file name in hard-disk is the file name of file-1, but the size is 43 KB and the content is the same as file-2.
When I open file-1 in the DVD using notepad++, the content is the content of file-2. Also, look like there is not 512 KB.
I also try the copy command in CMD prompt, but no luck, same behavior.
I also try to use 7zip to zip file-1, again 43 KB (not 512 KB) is zipped inside the zip file.
I search the internet. Some tell me that file-1 may be the short file name situation working in Win NT.
My questions are :
How can I PROVE that file-1 is the short file name of file-2 ? In this case, how can I look at the CONTENT of this 512 KB ? There is no debug command in Win7 to look at the 512 KB byte-by-byte.
How about, if file-1 is NOT the short file name of file-2, how can I copy the TRUE CONTENT of file-1 (i.e. the 512 KB file content) to the hard-disk ?
Thanks in advance.
Alvin SIU

Related

Winrar Settings, Batchfile or any other possibility to Monitor and create Archives automated

i searched in Winrar Settings but coudn't the Settings which i need, is there anyway to Setup Winrar to Monitor a specific Folder, and every Folder that gets put in that specific Folder should be packed to a sperate Archive, i don't need any compression, the Archive has to have:
Same Name as the Folder
Size Should not be bigger then 0,99 GB (1.073.000.000 bytes) if Size is bigger then the Archive should be splitted in max. 0,99 GB (1.073.000.000 bytes) Parts
Every Archive Should be Password protected (Same Password for every Archive)
Is it also Possible to set a command like Put in Every Archive the Content which is located in C:\FolderX
After successful creating the Archvies only the created Archive/ Parts should remain the the Folders and rest should be moved to Recycle Bin
C:\FolderX [Every File which is here Should be Put in Every Archvie which will be created]
C:\MainFolder [Every Folder which is here should be created to an Archvie like]
C:\MainFolder\Folder1 = 500 MB -> Folder1.rar = 500mb Password = xyz
C:\MainFolder\Folder2 = 1500 MB -> Folder2.part1.rar = 0,99 GB, Folder2.part2.rar = 427 MB Password = xyz
C:\MainFolder\Folder3 = 3500 MB -> Folder3.part1.rar = 0,99 GB, Folder3.part2.rar = 0,99 GB, Folder3.part3.rar = 0,99 GB, Folder3.part4.rar = 281 MB Password = xyz
When the Archvies are extracted they Should be like just 1 Folder with the content Folder1\textfile1, textfile2 etc
/ NO SubFolders Like Folder1\Fodler1\textfile1, textfile2
Winrar should only run process at time the rest should be put in queue.
Can this be done with a Batchfile and use the Batchfile as a Windows Service?
My OS is Windows 2019 Standard, i hope you guys can understand my English.
best regards
jimboy
WinRAR does not do that as it is for Windows, instead use RAR.exe (in the same folder as WinRAR.exe). The RAR manual is RAR.txt
RAR for Windows Command Line works with Batch files so can be tested and run from Windows by typing Cmd in the search bar.
It also works much better with the more advanced Windows Powershell.
PS. My RAR Command Line Secrets course will be available in 2021, you can register for Priority access at bit.ly/RCLSw-rN for more information about this affordable course.

Copying file in Windows 10 changes its size

I copied a large file to a new directory in Windows 10 by dragging the file from Explorer to a folder in Eclipse. The file size of the copied file changed even though fc shows the original and new files as identical. The original file has a size of 209,715,200 bytes (200 MiB):
c:\>dir c:\Users\GeoffAlexander\Documents\Python\200MiB.txt
Volume in drive C is Windows
Volume Serial Number is 0447-709A
Directory of c:\Users\GeoffAlexander\Documents\Python
08/13/2019 09:42 AM 209,715,200 200MiB.txt
1 File(s) 209,715,200 bytes
0 Dir(s) 268,331,835,392 bytes free
The new file has a size of 211,812,352 bytes:
c:\>dir c:\Users\GeoffAlexander\Desktop\200MiB.txt
Volume in drive C is Windows
Volume Serial Number is 0447-709A
Directory of c:\Users\GeoffAlexander\Desktop
08/15/2019 09:11 AM 211,812,352 200MiB.txt
1 File(s) 211,812,352 bytes
0 Dir(s) 268,232,798,208 bytes free
The fc command shows the files as being identical:
c:\>fc c:\Users\GeoffAlexander\Documents\Python\200MiB.txt c:\Users\GeoffAlexander\Desktop\200MiB.txt
Comparing files C:\USERS\GEOFFALEXANDER\DOCUMENTS\PYTHON\200MiB.txt and C:\USERS\GEOFFALEXANDER\DESKTOP\200MIB.TXT
FC: no differences encountered
Why does the copied file get a new size? How can two files with different sizes be identical? Is Windows 10 incorrectly reporting the size of the new file?
I'm running Windows 10 Enterprise Build 1809 (OS Build 17763.615) if that makes any difference.
It turns out the file size change wasn't due to the copying of the file. Rather the file size change occurred when checking in the file to RTC (Rational Team Concert). The RTC check in was converting existing LF line delimiters into CRLF line delimiters (Windows line delimiters). See RTC
File content types and line delimiters for details.

copyFromLocal - extra/empty files getting copied to HDFS

I created two sample files - 'file1.txt' and 'file2.txt' in a folder on my local filesystem in Ubuntu and copied them to HDFS using the dfs command copyFromLocal.
On browsing the copied files thru NameNode UI, I can see two extra files (file1.txt~ & file2.txt~ each of 0 KB) being copied to HDFS though there was no other file in that folder except file1.txt and file2.txt
Below is the information from the NameNode UI -
Name Type Size
file1.txt file 0.01 KB
file1.txt~ file 0 KB
file2.txt file 0.01 KB
file2.txt~ file 0 KB
Any suggestion/idea why these two extra files got created and how to fix this?

undeletable 0 byte file

I have a file in Wnidows/System32 that has a size of 0 bytes.
It's shown there in explorer and command prompt, bu I can't delete nor overwrite it. the system claims the file would not exist, but it stays there even after reboot.
The problem causes the installation of an app to fail because the installation also fails to overwrite the file.
I tried to delete via console,
I tried checkdisk, fileassassin, unlocker etc. all failed to delete the file.
I would be glad if anyone could help?
The system is a virtual Windows 2008 R2 server
c:\Windows\System32>dir /x msvcp*
Volume in drive C has no label.
Volume Serial Number is ECD7-BEFA
Directory of c:\Windows\System32
13.08.2014 15:17 0 msvcp100.dll
05.11.2012 23:26 661.456 msvcp110.dll
11.09.2013 19:39 614.000 MSVCP1~1.DLL msvcp110_clr0400.dll
14.07.2009 03:41 597.504 msvcp60.dll
4 File(s) 1.872.960 bytes
0 Dir(s) 93.173.768.192 bytes free
c:\Windows\System32>del /F msvcp100.dll
c:\Windows\System32\msvcp100.dll
The system cannot find the file specified.

How to determine compression method of a ZIP/RAR file

I have a few zip and rar files that I'm working with, and I'm trying to analyze the properties of how each file was compressed (compression level, compression algorithm (e.g. deflate, LZMA, BZip2), dictionary size, word size, etc.), and I haven't figured out a way to do this yet.
Is there any way to analyze the files to determine these properties, with software or otherwise?
Cheers and thanks!
This is a fairly old question, but I wanted to throw in my two cents anyway since some of the methods above weren't as easy for me to use.
You can also determine this with 7-Zip. After opening the archive there is a column for method of compression:
For ZIP - yes, zipinfo
For RAR, the headers are easily found with either 7Zip or WinRAR, read the attached documentation
Via 7-Zip (or p7zip) command line:
7z l -slt archive.file
If looking specifically for the compression method:
7z l -slt archive.file | grep -e '^---' -e '^Path =' -e '^Method ='
I suggest hachoir-wx to have a look at these files. How to install a Python package or you can try ActivePython with PyPM when using Windows. When you have the necessary hachoir packages installed, you can do something like this to run the GUI:
python C:\Python27\Scripts\hachoir-wx
It enables you to browse through the data fields of RAR and ZIP files. See this screenshot for an example.
For RAR files, have a look at the technote.txt file that is in the WinRAR installation directory. This gives detailed information of the RAR specification. You will probably be interested in these:
HEAD_FLAGS Bit flags: 2 bytes
0x10 - information from previous files is used (solid flag)
bits 7 6 5 (for RAR 2.0 and later)
0 0 0 - dictionary size 64 KB
0 0 1 - dictionary size 128 KB
0 1 0 - dictionary size 256 KB
0 1 1 - dictionary size 512 KB
1 0 0 - dictionary size 1024 KB
1 0 1 - dictionary size 2048 KB
1 1 0 - dictionary size 4096 KB
1 1 1 - file is directory
Dictionary size can be found in the WinRAR GUI too.
METHOD Packing method 1 byte
0x30 - storing
0x31 - fastest compression
0x32 - fast compression
0x33 - normal compression
0x34 - good compression
0x35 - best compression
And Wikipedia also knows this:
The RAR compression utility is proprietary, with a closed algorithm. RAR is owned by Alexander L. Roshal, the elder brother of Eugene Roshal. Version 3 of RAR is based on Lempel-Ziv (LZSS) and prediction by partial matching (PPM) compression, specifically the PPMd implementation of PPMII by Dmitry Shkarin.
For ZIP files I would start by having a look at the specifications and the ZIP Wikipedia page. These are probably interesting:
general purpose bit flag: (2 bytes)
compression method: (2 bytes)
For the ZIP files, there is a command zipinfo.
The zipfile python module can be used to get info about the zipfile.
The ZipInfo class provides information like filename, compress_type, compress_size, file_size etc...
Python snippet to get filename and the compress type of files in a zip archive
import zipfile
with zipfile.ZipFile(path_to_zipfile, 'r') as zip:
for info in zip.infolist():
print(f'filename: {info.filename}')
print(f'compress type: {info.compress_type}')
This would list all the filenames and their corresponding compression type(integer), which can be used to look up the compression method.
You can get a lot more info about the files using infolist().
The python module linked in the accepted answer is not available, zipfile module might help
The type is easy, just look at the file headers (PK and Rar).
As for the rest, I doubt that information is available in the compressed content.

Resources