When I run this command from the command line, I get the error RC 1107:
d:\dev\projects\res\compiler\rc.exe RC /r /fo d:\dev\projects\res\output\manifest.res d:\dev\projects\res\compiler\manifest.rc
All mentioned paths exists.
I am not in the drive and path when I call this command, but I would tend to think that it should not matter since I am giving the paths explicitely.
Thank you for the help.
Solution:
ChDrive "d:\"
ChDir "d:\dev\projects\res\compiler"
Then I called
"RC /r /fo ..."
from the command line.
I guess that I mixed up RC and rc.exe somehow. If anybody can give a clean explanation, I will of course accept his / her reply as the answer.
Related
The command
xcopy "$SITEPACKAGES\\google" "build\\lib\\google" /i /e /h fails with Invalid number of parameters on Windows on AppVeyor (Visual Studio 2019).
I’ve confirmed the correct syntax of the command in my Windows virtual machine on my computer where the command works as expected, and I’ve confirmed the correct setting of the $SITEPACKAGES variable and the escaped backslashes by echoing the same line: echo "$SITEPACKAGES\\google" "build\\lib\\google" /i /e /h produces C:\Python37-x64\Lib\site-packages\google build\lib\google /i /e /h, now with the quotes not showing anymore as expected.
The command is run from a shell schript as a normal command from appveyor.yml like so:
build_script:
- cmd: "sh wxPython/build/Windows/build-all.sh"
I’ve also tried not to escape the backslashes, but with same result.
I'm lost. Any ideas?
I believe there are some backslashes missing, as you can see from my attempts:
C:\Users\Gebruiker>xcopy C:\Python37-x64\Lib\site-packages\google build\lib\google /i /e /h
File not found - google
0 File(s) copied
C:\Users\Gebruiker>xcopy C:\Python37-x64\Lib\site-packages\google\ build\lib\google\ /i /e /h
Invalid path
0 File(s) copied
Anyway, I'd advise to make sure you always have double quotes around your paths, you never know when a space might arrive in a directory's name.
Still not sure yet what the problem is, but it has shown in another instance that there’s some real problem here. My other question shows a similar behaviour. It seems that options are being interpreted as file name input.
Meanwhile I've wanted to post a workaround that helped me, which is to copy through Python:
python -c "import shutil; shutil.copytree('$SITEPACKAGES\\google', 'build\\lib\\google')"
Found the cleanest solution: Don't mix Windows and Linux (WSL) environments in AppVeyor (or probably generally).
Either call a shell script using sh or bash and then copy folders the Unix way with cp -r $SITEPACKAGES/google build/lib/ with appveyor.yml:
build_script:
- cmd: sh somecommand.sh
or do it the Windows way and call a Windows batch script directly and then use Windows’ copy commands xcopy "$SITEPACKAGES\\google" "build\\lib\\google" /i /e /h with appveyor.yml:
build_script:
- somecommand.bat
I am running a build from Team Foundation Server(TFS), and the build is failing with the error
"xcopy "C:\eComObjects_MP10\Microsoft\DynamicsCrm"
"D:\Builds\19\Unicorn\MaintPackage10- Daily\Sources\MaintPackage10\WebInterface\Store\Inetpub\wwwroot\Bin\DynamicsCrm"
/E /Y /I " exited with code 4".
When I simply go to the command prompt and run the above command, it fails, but when this command is run after removing /E/Y/I and the double quotes at the end, it works fine from the command prompt. What might be wrong here ?
Since it's also failed with command prompt, so it's not related to TFS build.
Xcopy exit code 4 means "Initialization error occurred. There is not
enough memory or disk space, or you entered an invalid drive name or
invalid syntax on the command line."
There are various reasons for this. In your case it may due to the length of Source and Destination (Path length). resulting path names exceeded the maximum allowed length. It may due to the /e option /e : Copies all subdirectories, even if they are empty. Use /e with the /s and /t command-line options. Xcopy command reference.
For more ways, you could refer below similar question:
What is going wrong when Visual Studio tells me "xcopy exited with code 4"
Command copy exited with code 4 when building - Visual Studio restart solves it
In addition to the possibility of disk space or command line syntax errors, this can also occur due to permissions (and maybe other causes?)
What I would recommend is to open a command prompt and copy/paste the offending XCOPY command so you can see the actual error that's occurring. In my case it was "Access Denied" which prompted me to check the destination folder where I found that my user account didn't have appropriate access.
I'm trying to delete a folder in my output directory using the following command line:
del /F "$(TargetDir)Content\"
Tho I always end up exiting with error code 1. I've tried several different ways, without /F, with/without slash both before and after, etc.
Error 1 The command "del /F "E:\proj\bin\Windows\Debug\Content\"" exited with code 1.
There are a lot of questions regarding deleting files in post-build event command lines in visual studio, which works fine, but I can't seem to delete a folder without getting code 1.
Any help is appreciated!
RD /S /Q "Full Path of Folder"
In your case:
RD /S /Q "$(TargetDir)Content\"
Browse to the same folder using Command Prompt, and then run that command and see what the actual error is. Might be permissions or something is in use.
I'm trying to run a basic forfiles command, but no matter what mask I use it always simply prints the whole content of the directory. Not filtered for *.bat no "is a batch file", just a simple list off all files in C:\
I'm working on a winXPproffesional. What could be the cause?
forfiles /p c:\ /s /m *.bat /c "cmd /c echo #file is a batch file"
Somehow this version uses a different syntax:
FORFILES -pc:\ -s -m*.BAT -c"CMD /C Echo #file is a batch file"
works!
The command should work.
Maybe you have a FORFILES.BAT, FORFILES.CMD or bogus copy of FORFILES.EXE in either your current directory or another directory that happens to be in your PATH.
Try running this command from the command line to verify that the correct FORFILES.EXE is executing.
for %F in (forfiles.exe forfiles.bat forfiles.cmd) do #echo %~$path:F
If that is not the problem, then it looks to me like you have a bugged version of FORFILES.
Try using one option at a time to see which, if any of the options work
As a matter of fact, there's no forfiles in Windows XP but there is one in Windows 2003 Server, with the syntax as in your question.
Windows 2000 did have the tool, but only in the form of a resource kit, which had to be downloaded separately. For some reason, the corresponding Technet article doesn't list forfiles as part of the kit, although, as can be derived from this and this article, it must have been there initially. Maybe the guys at Microsoft decided to stop distributing the older version to avoid possible confusion with the newer one.
And yes, it seems like your forfiles copy is the older version, which does have a slightly different syntax, as explained in this post.
Is it possible to attach the windows debugger in VS2010 to a process from a batch file?
preferably by giving it a process name
Since you presumably already have the process running, you would use vsjitdebugger.exe /p 1234 where 1234 is the PID of the process you want to debug. If you don't know it, you would have to use some other method to figure it out.
If you have the debugging tools for windows available, the tlist.exe utility will yield the process ID for a process name. If that is available, then the following will attach to a given process:
rem Get the process ID
for /f %%f in ('tlist -p %1') do set mypid=%%f
rem attach to it with selected debugger
vsjitDebugger -p %mypid%
Edit If tlist is not available, I think tasklist will work. It's a bit uglier, but the following worked for me (you know ... it works my on my system :) Note too that I edited the command previous example to work in a cmd.exe prompt (I use tcc, which does require as many % signs).
rem Get the process ID
for /f "tokens=2 delims= " %%f in ('tasklist /nh /fi "imagename eq %1"' ) do set mypid=%%f
rem attach to it with selected debugger
vsjitDebugger -p %mypid%
Specifying a /Command switch on devenv.exe 's command-line will make it run a specified command on open. You could specify the Debug.AttachToProcess command. Don't know if you can specify a pid, though, when you execute that command.