mapped-drive

Cannot access files on drive mapped network share from a Windows service

限于喜欢 提交于 2019-12-17 20:35:36
问题 I have a network shared folder mapped to a drive letter, which is accessible from Windows Explorer, from the command prompt as well as from my WinForms application without problem. It is also accessible from my Windows service using a UNC path. However, when I attempt to access this network location using a mapped drive letter from the Windows service, access fails. The Windows service is configured to use my personal "Log On" account credentials, which is the same in all the above cases. I

Using PHP's fopen in windows on a network drive

廉价感情. 提交于 2019-12-13 21:36:57
问题 I have the following code: $file_name = "1234"; $filename = "L:\\videoette_converter\\batch_files\\".$file_name.'.bat'; if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } I get the following error from that code: Warning: fopen(L:\videoette_converter\batch_files\1234.bat) [function.fopen]: failed to open stream: No such file or directory in C:\wamp\www\videoette_converter\index.php on line 47 and the debug line from my php Cannot open file (L:\videoette

Accessing mapped drives when impersonating in ASP.NET

依然范特西╮ 提交于 2019-12-12 07:38:42
问题 Short version : Is it possible or not to use impersonation in ASP.NET to access mapped drives? Long Version: I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined for the user account I'm impersonating. For example, let's say a file lives on the network at \\machine\folder\file.txt , and let's also say that drive S: is mapped to \\machine

Mapping network drive using WNetAddConnection2 from “Run As Administrator” process does not work

自古美人都是妖i 提交于 2019-12-11 07:27:02
问题 I have an application which calls WNetAddConnection2 to map a network drive. This works perfectly unless I run the application as Administrator (right click - Run As Administrator) in which case the function returns 0 (success) but the mapped drive does not appear. What seems to be happening here is that there are two Contexts , the Admin one in which my program is running and the user one in which windows explorer is running and I am looking for the mapped drive. I think the drive mapping is

Service not able to access a mapped drive

假装没事ソ 提交于 2019-12-04 20:32:28
I have read in many forums that mapped drives are not accessible from a service as no user is logged on. Question 1) I tried making my service as a log on - as some account and i had my network drive mapped in that very account. The service still cannot access it. Why? Question 2) From the same sevice, i invoke another process. Under what user account will the process run? Thanks 1) Use UNC paths instead, then you do not need access to mapped drive letters. As to why you cannot access them even when running in the same account, it is hard to say for sure without seeing your actual code. 2) it

Accessing mapped drives when impersonating in ASP.NET

喜欢而已 提交于 2019-12-03 09:07:42
Short version : Is it possible or not to use impersonation in ASP.NET to access mapped drives? Long Version: I'm currently using impersonation in ASP.NET to gain access to network files. This is working perfectly for any network file using a UNC path, but it is failing to access any files on mapped drives defined for the user account I'm impersonating. For example, let's say a file lives on the network at \\machine\folder\file.txt , and let's also say that drive S: is mapped to \\machine\folder . We need to be able to access both the full UNC path, \\machine\folder\file.txt , as well as the

Determine Domain and username used to map a network drive

浪尽此生 提交于 2019-12-03 03:02:53
问题 Using Windows 7 Enterprise with SP1, but I'm hoping to get a generic answer that would apply to Windows XP/2003/2008/Vista/7. From a command prompt, I execute a net use command to map the Z: drive to a share on another computer, but I don't use my current credentials, I specify a different domain and user to map the drive. net use z: \\rd-pc2037\C_DRIVE password /user:rd-pc2037\Administrator The command completes successfully. Now that the drive is mapped, how can I find what Domain and

Mapping a network drive and checking for its existence in VBScript

旧巷老猫 提交于 2019-12-01 00:46:37
I need to map a network drive into a network path using VBScript. The network path is read directly from input. How should I map the network drive and how to check whether the entered network path already exists? I created a subroutine to map drives... MapDrive "H:","\\server\share" Sub MapDrive(letter, uncpath) on error Resume Next dim drivetype, currentmapping dim objWMIService dim colDisks, objDisk 'Set wshnetwork = CreateObject("Wscript.Network") Set objWMIService = GetObject("winmgmts:" & _ "{impersonationLevel=impersonate}!\\.\root\cimv2") Set colDisks = objWMIService.ExecQuery _ (

Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed

南笙酒味 提交于 2019-11-29 19:50:50
Using Windows 2008 R2. On our server we get this error: "Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again." when trying to map a drive on the command line. However, there are no open Explorer windows to the remote computer, and nothing shows on the remote computer when I do a "net use". Why does windows think something is connected when "net use" reports that there are no drives or folders open to it?? How can I force Win to stop thinking

In PowerShell, how can I determine if the current drive is a networked drive or not?

可紊 提交于 2019-11-29 10:22:07
I need to know, from within Powershell, if the current drive is a mapped drive or not. Unfortunately, Get-PSDrive is not working "as expected": PS:24 H:\temp >get-psdrive h Name Provider Root CurrentLocation ---- -------- ---- --------------- H FileSystem H:\ temp but in MS-Dos "net use" shows that H: is really a mapped network drive: New connections will be remembered. Status Local Remote Network ------------------------------------------------------------------------------- OK H: \\spma1fp1\JARAVJ$ Microsoft Windows Network The command completed successfully. What I want to do is to get the