Robocopy fail to create directories on local hard drive Error 1 Incorrect Function - sharepoint

I'm having an issue with robocopy in which every call to create a new directory on the destination fails. I get outputs such as:
2019/03/19 16:59:11 ERROR 1 (0x00000001) Creating Destination Directory T:\tmp\MIDCAS_SSP\Documents\Customer Reviews\MASPS 1 review\Received Comments\
The copy operation I am attempting is from a sharepoint list mapped to drive X: onto a subdirectory of a physical hard drive T:
OS Name Microsoft Windows 10 Home,
Version 10.0.17134 Build 17134
I have tried several variants, run command as both user and admin. Below is the commands and printout of one of many attempts.
PS T:\tmp\MIDCAS_SSP> .\Sync_XNet.bat
T:\tmp\MIDCAS_SSP>SET Target=T:\tmp\MIDCAS_SSP\Documents
T:\tmp\MIDCAS_SSP>ECHO T:\tmp\MIDCAS_SSP\Documents
T:\tmp\MIDCAS_SSP\Documents
T:\tmp\MIDCAS_SSP>Set XNetSource=X:
T:\tmp\MIDCAS_SSP>net use X: "\\site.name.domain#SSL\DavWWWRoot\sites\MidcasSSP\Shared Documents"
T:\tmp\MIDCAS_SSP>robocopy /XJ /ZB /MIR /FFT /NDL /TS /R:1 /W:2 "X: " "T:\tmp\MIDCAS_SSP\Documents "
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows :: Version XP010
-------------------------------------------------------------------------------
Started : Tue Mar 19 16:59:11 2019
Source = X:\
Dest : T:\tmp\MIDCAS_SSP\Documents\
Files : *.*
Options : *.* /FFT /TS /NDL /S /E /COPY:DAT /PURGE /MIR /ZB /XJ /R:1 /W:2
------------------------------------------------------------------------------
2019/03/19 16:59:11 ERROR 1 (0x00000001) Creating Destination Directory T:\tmp\MIDCAS_SSP\Documents\Customer Reviews\MASPS 1 review\Received Comments\
Incorrect function.
Waiting 2 seconds... Retrying...
2019/03/19 16:59:13 ERROR 1 (0x00000001) Creating Destination Directory T:\tmp\MIDCAS_SSP\Documents\Customer Reviews\MASPS 1 review\Received Comments\
Incorrect function.
ERROR: RETRY LIMIT EXCEEDED.
I've checked user and admin rights to the disk.
If I manually create the missing directories, any files therein are copied as intended until a new subdirectory is found but that's a lot of work to get through...
The above listing is using Windows 10 robocopy, but also using the Windows Server 2003 Resource Kit version I have the same problem.
I've also attempted to connect using https:// syntax for the net use command. After I post this I'll reboot as a last ditch attempt.
Ideas where I went wrong? Alternative approaches to back up a remote SharePoint sites' files to off-site disk?

I ran into the same problem, and googling brought me here. Ultimately I didn't find why it doesn't work, but a workaround that did the job for me was to copy the directory structure first using xcopy.
Example:
xcopy /t /e "\\intranet.companyname.com\departments\deptname\Procedures\" "z:\backup\"
robocopy.exe "\\intranet.companyname.com\departments\deptname\Procedures\" "z:\backup" /mir /R:0

Related

running SALOME in windows 10 gives "Can't find a free port" error

I'm trying to run SALOME GUI using run_salome.bat. GUI doesn't start and gives "Can't find a free port to launch omniNamesTry to kill the running servers and then launch SALOME again." error.
SALOME version 9.4
Windows 10
I have searched the files in C:\Users<username>\AppData\Roaming that contain "omniORB_PortManager" in their name and deleted them.
Here the issue can be resolved be removing several files generated by SALOME.
start a Windows file browser
in the search bar, type: %userprofile%\.config\salome
delete all files present in that directory
in the search bar, type: %APPDATA%\salome
remove all files present in that directory
in the search bar, type: %APPDATA%
delete all files wich name starts with: .omni
delete file: .salome_PortManager.cfg
Finally, I strongly suggest to raise such questions directly on SALOME forum at this link

folder path with space giving error in subprocess.call

drivesToMap = ["R: \\\\server1\folder", "G: \\\\server1\folder withSpace"]
for eachDrive in drivesToMap:
call("net use " + eachDrive)
In python 3 on a windows 10 machine I am getting the following error for the code above :
System error 1232 has occurred.
The network location cannot be reached. For information about network troubleshooting, see Windows Help.
How do I resolve the space? When I type in the command from a doc cmd it works succussfully:
net use G: \server1\folder withSpace
You likely need to wrap the drive in an additional set of quotes, since net use is a command prompt command it is anticipating that the drive name (which has spaces) is actually multiple arguments instead of one.
For instance:
drivesToMap = ["'R: \\\\server1\folder'", "'G: \\\\server1\folder withSpace'"]

Node Module Path Execution Windows 10

$ npm install -g static-server
C:\Users\Stuart's\AppData\Roaming\npm\static-server -> C:\Users\Stuart's\AppData\Roaming\npm\node_modules\static-server\bin\static-server.js
+ static-server#2.2.1
added 13 packages from 6 contributors in 1.238s
Stuart's#Stuarts-PC MINGW64 ~/Documents/GitHub/PIES-Network/dapp (master)
$ static-server
module.js:549
throw err;
^
Error: Cannot find module 'C:\c\Users\Stuart's\AppData\Roaming\npm\node_modules\static-server\bin\static-server.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
clearly "C:\c\User.." is not a correct path to my node modules directory. I have checked my local paths and everything looks fine. Any help is appreciated Thanks
This looks a lot like you have accidentally created a directory called C:\c\Users\Stuart's\AppData\Roaming\npm wherein is located the file static-server.cmd. You have a path variable pointing there also somehow.
When static-server is invoked control is passed to the static-server.cmd batch file at this incorrect location.
node 'C:\c\Users\Stuart's\AppData\Roaming\npm\node_modules\static-server\bin\static-server.js
But static-server.js is located as per your install at:
C:\Users\Stuart's\AppData\Roaming\npm\node_modules\static-server\bin\static-server.js.
In these circumstances you will get exactly the errors shown.
It could be some variation on this and I am happy to help further, but step 1 is to check above because for sure the incorrect path parameter is being passed to node (which of course load and executes static-server.js).
EDIT: Here are some further tests:
Search for all instances of "static-server" on your hard disc.
Trying to do this with Explorer will take a long time.
The best and fastest way is to download a tool called UltraSeach.
Here are the search results from my PC ( I created the extra C:\c directory for test purposes).
Check for multiple versions of static-server.cmd or other executable file of that name.
Using a text editor (like notepad) open each static-server.cmd file and add these ECHO commands at the top
(ie before the line staret with #IF EXIST "%~dp0\node.exe" (
ECHO "File 1 executing"
ECHO "%~dp0"
PAUSE
If more than one version put "File 2", "File 3" etc.
Now type static-server at a command prompt and it should
Echo the message "File n executing"
Echo the directory it is executing from
Wait for you to press a key to continue.....
Note the directory it is executing from (call it \CURRENT say)
You can see from static-server.cmd that it then starts node
and tried to execute \CURRENT\node_modules\static-server\bin\static-server.js
In your case its not finding static-server.js where node expects to find it.
Look back to search results in step 1 and see where static-server.js is actually located.
Compare this to where node expects to find it in step 5.
Your problem is either that:
The static-server.cmd being executed is located in the wrong place OR
static-server.js is located at the wrong place.
Here is an additional test. Open a command window and navigate to the directory which has static-server.js. As per the screen-shot it is at C:\Users\Brendan\AppData\Roaming\npm\node_modules\static-server\bin in my case.
Then type node static-server.js. This bypasses the static-server.cmd file altogether, and should start the server. Worked in my case.
Let me know how you go!

MoveFileEx with MOVEFILE_REPLACE_EXISTING flag Fails with LastError = 183

We have an application that makes a backup of a configuration file by copying it to a sub-folder (see log file entry below) using the following command:-
BOOL b = MoveFileEx(ExistingFileSpec, NewFileSpec, MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH | MOVEFILE_COPY_ALLOWED);
This appears to work as expected on most systems but on two we get the following warning in our log file:-
11 Jun 2018 10:58:05.437 W. COMMON WARNING MoveFile failed on C:\Program Files\Configuration\Stores.xml to C:\Program Files\Configuration\Backup\Stores.xml LastError=183
Lasterror =183 means "ERROR_ALREADY_EXISTS"
This is odd since MOVEFILE_REPLACE_EXISTING is specifically meant to enable this command to work when the target file exists.
This is happening on Win7 x86 machines.
In a previous version of the code MoveFile was used but with a DeleteFile call immediately prior to ensure the target file did not exist. When the code was rolled back to this version it works.
Any suggestions?

How to remove multiple virtual directories?

I need to remove a big amount of virtual directories, some of them don't have associated physical directories.
Ideas?
As you need to remove a large amount, I'm guessing you'll want to use some form of script.
IIS 6.0, using IISvdir.vbs( article # MSDN):
At the command prompt, use the cd command to change to the directory where the Iisvdir.vbs script is installed. The default location for this file is systemroot/system32/iisvdir.vbs.
At the command prompt, type:
cscript iisvdir.vbs /delete "Sample Web Site" VirtualDirectoryName.
Substitute your Web site name and virtual directory name as appropriate. If there are spaces in the Web site name, use quotation marks around the Web site name, as shown in the preceding example.
IIS 7 using AppCmd.exe (article # TechNet):
To remove a virtual directory, use the following syntax:
appcmd delete vdir /vdir.name: string
The variable vdir.namestring is the virtual path of the virtual directory.
For example, to remove a virtual directory named photos from the root application of a site named contoso, type the following at the command prompt, and then press ENTER:
appcmd delete vdir /vdir.name: contoso / photos
To remove a virtual directory named photos from an application named marketing in a site named contoso, type the following at the command prompt, and then press ENTER:
appcmd delete vdir /vdir.name: contoso / marketing / photos
HTH
You could also write an msbuild script to do this and use the msbuild extension pack which is available here. I have used this successfully to do exactly what you are saying for 100s of vdirs in iis 6 AND in iis 7.5.
Its pretty simple and took me longer to write the .proj file than it did to figure out how to do it.
have fun :)
the resultant msbuild target would look like as follows
<Target Name="IIS7VirtualDirectories:Delete">
<MSBuild.ExtensionPack.Web.Iis7Application
TaskAction="Delete"
Website="%(Application.WebsiteName)"
Applications="#(Application)"
MachineName="$(MachineName)"
ContinueOnError="false"/>
<MSBuild.ExtensionPack.Web.Iis7Website
TaskAction="DeleteVirtualDirectory"
Name="%(VirtualDirectory.WebsiteName)"
VirtualDirectories="#(VirtualDirectory)"
ContinueOnError="false"
MachineName="$(MachineName)"/>
</Target>
Where Application and VirtualDirectory are defined in an external proj file :)

Resources