drive

listing network shares with python

╄→尐↘猪︶ㄣ 提交于 2019-11-28 13:41:59
if I explicitly attempt to list the contents of a shared directory on a remote host using python on a windows machine, the operation succeeds, for example, the following snippet works fine: os.listdir("\\\\remotehost\\share") However, if I attempt to list the network drives/directories available on the remote host, python fails, an example of which is shown in the following code snippet: os.listdir("\\\\remotehost") Is anyone aware of why this doesn't work?, any help/workaround is appreciated. May be pysmb can help For anyone still wondering how to list network shares at the top level on

Drive API V3 - Searching on list service doesn't work with Uppercase accents

久未见 提交于 2019-11-28 09:39:06
问题 I’m meeting a problem using the Google Drive API v3. I have files in my Drive which have uppercase accents (screen 1). When I use the Google API with the list method with this kind of q parameter : name = ‘Évenement’ Nothing comes out. The problem seems to be the uppercase accent (it works fine in lowercase) in my word, the search works great with the Google Drive interface : But it fails when I do it with the API : How should I encode or modify my query to make it work ? Please note that I’m

Programatically ejecting and retracting the CD drive in vb.net or c#

删除回忆录丶 提交于 2019-11-28 08:49:26
Is there any way to do so? I know its possible to programmatically eject/retract the cd drive SOMEHOW, cause Roxio does that when it prompts me to insert a disk. Either c# or vb.net is preferable, but c and c++ are okay too as a last resort. I am nearly positive there is some way to do this, I just don't know the methods to call. I do understand this is a somewhat unusual request, as Google yielded absolutely nothing when I searched for the methods... using System.Runtime.InteropServices; [DllImport("winmm.dll")] static extern Int32 mciSendString(String command, StringBuilder buffer, Int32

listing network shares with python

荒凉一梦 提交于 2019-11-28 08:12:04
问题 if I explicitly attempt to list the contents of a shared directory on a remote host using python on a windows machine, the operation succeeds, for example, the following snippet works fine: os.listdir("\\\\remotehost\\share") However, if I attempt to list the network drives/directories available on the remote host, python fails, an example of which is shown in the following code snippet: os.listdir("\\\\remotehost") Is anyone aware of why this doesn't work?, any help/workaround is appreciated

Get drive label in C#

巧了我就是萌 提交于 2019-11-28 07:09:37
问题 When I use System.IO.DriveInfo.GetDrives() and look at the .VolumeLabel property of one of the drives, I see "PATRIOT XT", which is indeed the drive's volume label. If I open "My Computer", instead I see "TrueCrypt Traveler Disk", and I can't seem to find any way to programmatically retrieve that value as none of the DriveInfo properties hold that value. I also tried querying the information via WMI's Win32_LogicalDisk , but no properties contained that value there either. So any idea what

How to change current working directory using a batch file

泄露秘密 提交于 2019-11-27 19:51:19
问题 I need some help in writing a batch file. I have a path stored in a variable root as follows: set root=D:\Work\Root Then I am changing my working directory to this root as follows: cd %root% When I execute this batch file from anywhere on the D drive this is done successfully. But when I execute the same batch file from some other drive, cd %root% doesn't work. Is there a way I can get the drive letter from the root variable? I can then change the current directory to this drive first and

Combine `Get-Disk` info and `LogicalDisk` info in PowerShell?

自古美人都是妖i 提交于 2019-11-27 08:44:51
I have this query which scans all logical disks information : Write-Host "Drive information for $env:ComputerName" Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DriveType -ne 5} | Sort-Object -Property Name | Select-Object Name, VolumeName, VolumeSerialNumber,SerialNumber, FileSystem, Description, VolumeDirty, ` @{"Label"="DiskSize(GB)";"Expression"={"{0:N}" -f ($_.Size/1GB) -as [float]}}, ` @{"Label"="FreeSpace(GB)";"Expression"={"{0:N}" -f ($_.FreeSpace/1GB) -as [float]}}, ` @{"Label"="%Free";"Expression"={"{0:N}" -f ($_.FreeSpace/$_.Size*100) -as [float]}} | Format-Table

Programatically ejecting and retracting the CD drive in vb.net or c#

旧城冷巷雨未停 提交于 2019-11-27 05:48:07
问题 Is there any way to do so? I know its possible to programmatically eject/retract the cd drive SOMEHOW, cause Roxio does that when it prompts me to insert a disk. Either c# or vb.net is preferable, but c and c++ are okay too as a last resort. I am nearly positive there is some way to do this, I just don't know the methods to call. I do understand this is a somewhat unusual request, as Google yielded absolutely nothing when I searched for the methods... 回答1: using System.Runtime.InteropServices

Push git changes to a shared network drive

瘦欲@ 提交于 2019-11-27 04:56:20
问题 How can a team of four people use Git (specifically Github for Windows) to push local changes to a shared network drive? Right now (without Git) we have to copy the files from the network drive to our local machine, edit the files, and then re-upload them to the shared network drive. This is a painstaking process that can lead to lots of errors, but it seems like something Git could help us with. Can we simply install Git on the shared drive and go from there? 回答1: Not sure if you found

What is the best way to map windows drives using Python?

久未见 提交于 2019-11-27 03:19:06
What is the best way to map a network share to a windows drive using Python? This share also requires a username and password. I'd go with IronPython and this article : Mapping a Drive Letter Programmatically . Or you could use the Win32 API directly. aqua Building off of @Anon's suggestion: # Drive letter: M # Shared drive path: \\shared\folder # Username: user123 # Password: password import subprocess # Disconnect anything on M subprocess.call(r'net use m: /del', shell=True) # Connect to shared drive, use drive letter M subprocess.call(r'net use m: \\shared\folder /user:user123 password',