drive

WMI获取磁盘信息

对着背影说爱祢 提交于 2020-03-02 16:53:37
  这段时间写有关获取磁盘信息的demo,通过WMI能实现 磁盘驱动器的信息读取(Win32_DiskDrive class) 和 逻辑分区的信息读取(Win32_LogicalDisk class)。如何在显示物理驱动器时也能同时显示下属分区的信息?我从一个博客中找到了答案: 代码 private void GetAllDisk1() { foreach (ManagementObject drive in new ManagementObjectSearcher( " select * from Win32_DiskDrive " ).Get()) { // associate physical disks with partitions string type = drive[ " Caption " ].ToString(); foreach (ManagementObject partition in new ManagementObjectSearcher( " ASSOCIATORS OF {Win32_DiskDrive.DeviceID=' " + drive[ " DeviceID " ] + " '} WHERE AssocClass = Win32_DiskDriveToDiskPartition " ).Get()) { Console.WriteLine

Task Scheduler - Access non-local drives while running task not logged in

假装没事ソ 提交于 2020-02-18 05:33:31
问题 I had a task in win scheduler that runs every minute. The task runs a .bat file which SVN updates a series of folders then executes a perl script (which in turn will run off several others). The output/'log' of the perl script (tagged by date/time) is sent to a shared drive, not local to the machine the task runs on. The whole task works flawlessly until sending the log to the shared drive. Since the task needs to run every minute I figured it would be best to use the setting 'Run whether

Task Scheduler - Access non-local drives while running task not logged in

痴心易碎 提交于 2020-02-18 05:33:12
问题 I had a task in win scheduler that runs every minute. The task runs a .bat file which SVN updates a series of folders then executes a perl script (which in turn will run off several others). The output/'log' of the perl script (tagged by date/time) is sent to a shared drive, not local to the machine the task runs on. The whole task works flawlessly until sending the log to the shared drive. Since the task needs to run every minute I figured it would be best to use the setting 'Run whether

Get text from PDF in Google

ぐ巨炮叔叔 提交于 2020-01-24 00:25:10
问题 I have a PDF document that is saved in Google Drive. I can use the Google Drive Web UI search to find text in the document. How can I programmatically extract a portion of the text in the document using Google Apps Script? 回答1: See pdfToText() in this gist. To invoke the OCR built in to Google Drive on a PDF file, e.g. myPDF.pdf , here is what you do: function myFunction() { var pdfFile = DriveApp.getFilesByName("myPDF.pdf").next(); var blob = pdfFile.getBlob(); // Get the text from pdf var

Google script: Download web image and save it in a specific drive folder

半城伤御伤魂 提交于 2020-01-23 12:34:53
问题 I need to download an image with GS and save it in a specific drive folder. I'm able to save the image in the root folder but i cannot save it in a specific folder: function downloadFile(fileURL,folder) { var fileName = ""; var fileSize = 0; var response = UrlFetchApp.fetch(fileURL, {muteHttpExceptions: true}); var rc = response.getResponseCode(); if (rc == 200) { var fileBlob = response.getBlob() var folder = DriveApp.getFoldersByName(folder); if (folder != null) { var file = DriveApp

Upload CSV to Google Sheets using gspread

半城伤御伤魂 提交于 2020-01-04 02:35:50
问题 I have a Json object which needed to be uploaded to the Google Spreadsheet. I have searched and read various resources but could not find the solution. Is there a way to upload object or csv from locally to google spreadsheet using gspread. I will prefer not to use google client api. Thanks 回答1: You can import CSV data using gspread.Client.import_csv method. Here's a quick example from the docs: import gspread # Check how to get `credentials`: # https://github.com/burnash/gspread gc = gspread

how to publish to the web a spreadsheet using drive API and GAS

老子叫甜甜 提交于 2020-01-03 03:19:27
问题 I activate the drive API, (V2), and I try to publish to the web a file I try the following, but obviously, I miss something (the resource). Can somebody help me? many thanks in advance function test(){ var fileId = '1c5fRpKAk2YdUVzCa1LOCqDgTLZmYjsfSvTzR9BSGPYo'; var revisions = Drive.Revisions.list(fileId); var items = revisions.items; var revisionId = items[items.length-1].id; var resource; Drive.Revisions.update( resource , fileId, revisionId).published = true; } 回答1: several months later,

C# dropbox of drives

流过昼夜 提交于 2020-01-01 14:21:03
问题 I remember in vb6 there was a control that was similar to a dropbox/combobox that you can select the drive name. It raises an event which you can then set another control which enumerate files in listbox. (in drive.event you do files.path = drive.path to get this affect). Is there anything like this in C#? a control that drops down a list of available drives and raises an event when it is changed? 回答1: There's no built-in control to do that, but it's very easy to accomplish with a standard

Finding out which drive was booted in x86 bootloader

家住魔仙堡 提交于 2019-12-31 07:00:14
问题 I'm writing a game bootloader for x86. At one point, early in the booting, I need to load some sectors from my boot drive into memory. I do this with interrupt 0x13 (ah=02), and when I try it in my virtual machine it works like a charm. However when I burn the image to a usb drive, the machine fails to boot, and I pinned it down to the sector loading instructions, apparently my usb drive isn't drive 0 (Floppy A), so the read fails. How can I determine which drive was used to boot? Thanks! 回答1

Program throws NullPointerException when i try to search in drives?

帅比萌擦擦* 提交于 2019-12-30 06:53:09
问题 I wrote a program to find file or directory. Its working properly when i am trying to Search file with in Directory example java FileSearch abc.txt f:\xyz But when i am try to search file from local drive than program throw Exception java FileSearch abc.txt f:\ after Showing all the search result throws NullPointerException. code is : import java.io.*; class FileSearch{ static String fd; static boolean flg=true; public static void main(String arr[]){ fd=arr[0]; String path=arr[1]; String dir[