network-drive

Mapping a network drive and checking for its existence in VBScript

只谈情不闲聊 提交于 2019-12-19 04:24:55
问题 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? 回答1: 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(

Mapping a network drive and checking for its existence in VBScript

筅森魡賤 提交于 2019-12-19 04:24:19
问题 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? 回答1: 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(

Easiest way in C# to find out if an app is running from a network drive?

扶醉桌前 提交于 2019-12-18 12:15:01
问题 I want to programmatically find out if my application is running from a network drive. What is the simplest way of doing that? It should support both UNC paths ( \\127.0.0.1\d$ ) and mapped network drives (Z:). 回答1: This is for mapped drive case. You can use the DriveInfo class to find out whether drive a is a network drive or not. DriveInfo info = new DriveInfo("Z"); if (info.DriveType == DriveType.Network) { // Running from network } Complete method and Sample Code. public static bool

How can I query a temporary PS-Drive while returning files with a name relative to the drive?

我的未来我决定 提交于 2019-12-18 07:36:30
问题 I am trying to create a script where I will be searching the file servers for non inherited permissions. I have run into the 260 character limit for file names as a result. A suggestion I saw, that I thought would help, a couple of times was to create some non persistent PS Drives a couple of levels deep and query those. Problem is when I use Get-ChildItem against the new PS Drives it is returning object with the full network path and not using the name I assigned it. # Cycle the folders Get

Mapping a network drive without hardcoding a drive letter in a batch file

守給你的承諾、 提交于 2019-12-17 18:37:31
问题 I need to map a network drive with a batch file, but don't want to specify the drive letter. The batch file is used as part of a deployment process; I call the batch file from CruiseControl.Net , the batch file needs to map a UNC path which requires credentials to authenticate. Then the batch file calls RoboCopy to deploy the website from the output directory to the destination (and excludes some files and folders). Finally the batch deletes the network drive. The problem is that this isn't

Copy file on a network shared drive

你。 提交于 2019-12-17 04:52:42
问题 I have a network shared drive ("\serveur\folder") on which I would like to copy file. I can write on the drive with a specific user ("user"/"pass"). How can I access the shared drived with write privilege using C#? 回答1: Untested code, but it will be similiar to: AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); // http://pinvoke.net/default.aspx/advapi32/LogonUser.html IntPtr token; LogonUser("username", "domain", "password", LogonType.LOGON32_LOGON_BATCH,

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

Connecting to a database on a LAN network location

不问归期 提交于 2019-12-13 01:18:38
问题 I have an application that I want to access a file over a network. I am currently using this connection string. string myconnectionstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=\\" + PCName + "\\datafolder\\data.mdb"; The Pc name is the name of well the computer as seen on the network I get that using: Dll Netapi32 however while i do get the path exactly as it should be my code adds "C:" to the path instead of "\PCNAME\datafolder\data.mdb" I have read a lot on this and none of it

Network Drive Not Available On Startup

青春壹個敷衍的年華 提交于 2019-12-12 14:36:23
问题 I have a C# application which loads at startup, and logs data to a network drive, which is mounted as X: When the machine first boots, the application throws an error that X:\ is not available. If I restart the app, same error. However, if I open Windows Explorer and double click to browse the drive, I can then run the application and it will connect to X: just fine. Do network drives not automatically initialise on startup, despite being mapped? Is there a way to set them to initialise

RStudio: unexpected call to `dir.create()` with the first instruction within a project stored on a network drive

徘徊边缘 提交于 2019-12-12 10:35:59
问题 First, apologies for a lack of a reproducible example, but I cannot really provide one as I believe the problem lies within my network settings. Please treat this question as a call for help in debugging the issue... After opening in RStudio a project stored on a network drive and running the very first instruction (being it a package load or even a <- 1 ) I am seeing a really weird output in the console: > a <- 1 Warning message: In dir.create(tempPath, recursive = TRUE) : cannot create dir