hard-drive

Is it possible to determine the Win32_DiskDrive SerialNumber of the Environment.SpecialFolder.System drive?

旧时模样 提交于 2020-01-02 17:35:27
问题 I've been going around in circles for a bit now, can't seem to find the answer on google either. As the title says, if i get the current drive letter windows is running on, let's say like this: Path.GetPathRoot(Environment.GetFolderPath(Environment.SpecialFolder.System)); Can i then determine its Win32_DiskDrive SerialNumber? I cannot find a way to link them. That is the manufacturer's S/N not the VolumeSerialNumber. Thanks in advance 回答1: You can use ManagmentObjectSearch combined with

issuing hard drive commands with java

醉酒当歌 提交于 2019-12-31 04:06:11
问题 Does anyone know of a way to issue commands to a hard drive within Java? Does Java even support this kind of hardware interaction? For example, if I have a SCSI hard drive that I would like to inquiry, is there a pre-existing Java method to do this, or would I have to write my own? http://en.wikipedia.org/wiki/SCSI has some general information on SCSI commands in case you aren't familiar. 回答1: Java doesn't support talking directly to hardware like that. However, you can use JNI to call a C/C+

check for bad sectors on hard disk

匆匆过客 提交于 2019-12-31 03:46:58
问题 Recently after a couple of power outages, my computer has gotten quite messed up (BSODs every now and then, entire OS behaves really strange). Now I have a program that ran perfectly fine before my computer got messed up. This program just basically creates a file using CreateFile and writes to it using WriteFile. This program also has other stuff doing their thing based on this file. I noticed that the entire program acted strangely as well. My debugging results: I noticed that after

How to obtain direct access to raw HD data in C?

微笑、不失礼 提交于 2019-12-30 07:00:21
问题 I need to do a complete format on a USB stick (FAT16 or FAT32), put a file on the drive, then delete it and recover the file using a C program. Could anyone give me a hint on what should I use to accomplish this? I understand the layouts of the FAT16/32 filesystems, the problem is that I don't know how to access the raw HD data using C (since I can't use things like fopen or mmap because the file isn't there anymore). 回答1: This is highly operating system specific. For Linux, you would open

Powershell: how to map a network drive with a different username/password

喜你入骨 提交于 2019-12-29 03:36:06
问题 Background: Assume I use the following powershell script from my local machine to automatically map some network drives. $net = $(New-Object -ComObject WScript.Network); $net.MapNetworkDrive("p:", "\\papabox\files"); $net = $(New-Object -ComObject WScript.Network); $net.MapNetworkDrive("q:", "\\quebecbox\files"); ## problem -- this one does not work because my username/password ## is different on romeobox $net = $(New-Object -ComObject WScript.Network); $net.MapNetworkDrive("r:", "\\romeobox

Bash script for searching directory and moving files to a new directory, deleting any copies

…衆ロ難τιáo~ 提交于 2019-12-25 04:46:11
问题 I have a 2TB hard drive full of backed up data, including hundreds of movies, most of which have been copied several times due to sequential back-ups of the same HD. The hard drive is organized as a list of back-up folders, and every back-up contains a movies folder that has all the movies that were on my laptop HD at the time of the back-up. I'd like to create a new movies folder and move all movies from every "movies" subfolder into the new one, making sure not to move the same movie twice.

Retrieve the partition number of BootMgr on Windows Vista and later

痴心易碎 提交于 2019-12-24 05:32:36
问题 I need to map Boot Manager to a partition number: Manufacturer Recovery partition = Partition 0 Boot manager = Partition 1 C:\ = Partition 2 D:\ = Partition 3 For mounted partitions, like C:\ or D:\, I use IOCTL_STORAGE_GET_DEVICE_NUMBER to retrieve partition numbers. Now I would like to do something similar to get the number of the Windows Boot Manager. I can't assume that the BootMgr is the 100 MB partition or the previous to the System partition. I have had a look to IOCTLs related to disk

Retrieve the partition number of BootMgr on Windows Vista and later

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 05:32:07
问题 I need to map Boot Manager to a partition number: Manufacturer Recovery partition = Partition 0 Boot manager = Partition 1 C:\ = Partition 2 D:\ = Partition 3 For mounted partitions, like C:\ or D:\, I use IOCTL_STORAGE_GET_DEVICE_NUMBER to retrieve partition numbers. Now I would like to do something similar to get the number of the Windows Boot Manager. I can't assume that the BootMgr is the 100 MB partition or the previous to the System partition. I have had a look to IOCTLs related to disk

how to list all files names under a folder in hard drive?

梦想与她 提交于 2019-12-24 03:58:05
问题 I want to list all files names exist under folder in hard drive with vb.net , and i don't know how.First ,i choose a folder with folderbrowser component, next,i list all files Here is my code (only for choose a folder) dossier_disque.ShowDialog() txt_folder.Text = dossier_disque.SelectedPath for list all files , i tried to use for each , but it's not correct my code when i tried to list file Dim files() As String = Directory.GetFiles(txt_folder.Text) For Each a In CStr(files.Count) folder

NASM: Disk read timeout

拈花ヽ惹草 提交于 2019-12-24 00:02:50
问题 Trying to read data from disk (from the same file), loading 2 additional 512-byte sectors into memory. Disk read function as is: ; read DH sectors to ES:BX from drive DL disk_read: push dx push bx ; Tried to check if disk is ready first, this code runs without errors mov ah, 0x10 int 0x13 jc disk_not_ready mov bx , DISK_CURRENT_STATUS_MSG call print_string mov bx, 0 mov bl , ah call print_hex pop bx mov ah , 0x42 ; BIOS read sector function mov al , dh ; Read DH sectors mov ch , 0x00 ; Select