%PATH% on Windows 2008 Server actually not working - path

As you can see below, %AppData%\npm is added in the system Path variable. I've also tried adding it to the User Path variable. The file grunt.cmd exists in the directory, but only works if I specify it with an absolute path. AKA, path does not work.
C:\Users\TeamCity>echo %path%
%AppData%\npm;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows
\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\Microsoft SQL Server\10
0\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program F
iles\Microsoft SQL Server\100\DTS\Binn\;c:\Program Files (x86)\Microsoft SQL Ser
ver\100\Tools\Binn\VSShell\Common7\IDE\;c:\Program Files (x86)\Microsoft SQL Ser
ver\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program
Files\nodejs\
C:\Users\TeamCity>dir %appdata%\npm
Volume in drive C has no label.
Volume Serial Number is B845-1135
Directory of C:\Users\TeamCity\AppData\Roaming\npm
05/29/2013 03:14 AM <DIR> .
05/29/2013 03:14 AM <DIR> ..
05/29/2013 03:14 AM 298 grunt
05/29/2013 03:14 AM 159 grunt.cmd
05/29/2013 03:13 AM <DIR> node_modules
2 File(s) 457 bytes
3 Dir(s) 23,690,498,048 bytes free
C:\Users\TeamCity>grunt
'grunt' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\TeamCity>%appdata%\npm\grunt
grunt-cli: The grunt command line interface. (v0.1.9)
Running on:
Windows Server 2008 R2 Datacenter
Service Pack 1
64-bit

I don't think you can defer variable expansion in the path. What's in the path is used as is, it doesn't get re-interpreted during a search.
In fact, you must have worked really hard to get that in as %AppData% since you would need to do something like:
path=^%AppData^%\npm;%path%
If you were to just use:
path=%AppData%\npm;%path%
you'd find the actual path would be substituted, so that the path becomes:
C:\Users\TeamCity\AppData\Roaming\npm;C:\Windows\system32; ...

Interestingly enough, a last-ditch effort of "turning it off and on again" actually worked. Alternatively, you can copy the whole path after you added it and type in cmd:
> SET PATH=
and paste your path.

Related

Unit not found: 'System.pas' or binary equivalents (.dcu) : Compiling on jenkins

I'm using Jenkins to generate automatic build every 15 minutes for a test project.
When compiling for Delphi itself does not give a problem, now when I run by jenkins it gives the following problem ...
C:\Program Files (x86)\Embarcadero\RAD
Studio\7.0\Bin\CodeGear.Delphi.Targets(136,3): error : Project1.dpr(1)
Fatal: F1027 Unit not found: 'System.pas' or binary equivalents (.dcu)
I have already tried to run by windows command this way.
cd "C:\Users\carlos.santos\Desktop\teste"
call build.bat
And Build.bat in this way.
call "C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\bin\rsvars.bat"
msbuild "Project1.dproj" /p:config=Release /p:Warn=0
I have already tried to run by the Rad Studio plugin itself for Jenkins this way and it also did not work.
I have already seen in some forums that if I have many paths or do not have the default paths of Delphi in Library path can be a problem, but I have tested this too and nothing ..
Here are the paths I have.
$ (BDS) \ lib; $ (BDS) \ Imports; $ (BDS) \ Lib \ Indy10; $
(BDSCOMMONDIR) \ Dcp; $ (BDS) \ include; $ (BDS) \ RaveReports \ Lib;
$ (BDSCOMMONDIR) \ Bpl; $(BDS)\lib\debug; $(BDS)\bin; $(DELPHI)\Bin;
The Content of rsvars.bat are there:
#SET BDS=C:\Program Files (x86)\Embarcadero\RAD Studio\7.0
#SET BDSCOMMONDIR=C:\Users\Public\Documents\RAD Studio\7.0
#SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v2.0.50727
#SET FrameworkVersion=v2.0.50727
#SET FrameworkSDKDir=
#SET PATH=%FrameworkDir%;%FrameworkSDKDir%;%PATH%
#SET LANGDIR=EN
I have third party component installed in my Delphi, but I do not know if it influences anything. Anyone who can help me will be grateful.
the difference between the properties executed by jenkins and cmd are these:
it was resolved putting the paramether _EnvLibraryPath with my Delphi
LibraryPath parameter on msbuild call, example:
call "C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\bin\rsvars.bat"
msbuild "C:\Users\carlos.santos\Desktop\teste\Project1.dproj" /p:_EnvLibraryPath="C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib\EN;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib"
There may be another cause for that same problem.
I have just experienced it and solved it.
In my case, it was related to the fact that I had another configuration besides Release and Debug, i.e. ReleaseConsumer.
My build command included specifying the configuration:
DoJenkinsTasks "US2D_GUI" "Config=ReleaseConsumer;Platform=Win64"
Now, I got that same error as mentioned above.
The cause is that it can't find the ReleaseConsumer folder with dcu files.
I solved it by creating, under c:\Program Files (x86)\Embarcadero\Studio\19.0\lib\win64\, a new folder releaseConsumer and copying all dcu files from release to it.
Run msbuild with the /v:diagnostic option, and you will see that none of the default environment paths are set:
Initial Properties:
___ResourcePath =
__ObjectPath =
__ResourcePath =
_EnvDCPOutput =
_EnvLibraryPath =
_EnvNamespace =
_EnvPackageOutput =
_ObjectPath =
_OutputDRCFiles = false
_ProjectFiles = #(DelphiCompile)
_ResolveGENTLBBindingsTarget =
This is because you are missing the %APPDATA%\CodeGear directory on your build server (under the user that is running the builds).
Particularly, you need the CodeGear\BDS\7.0\EnvOptions.proj settings file, which contains all the environment variables.
Put that in place and you'll see msbuild's diagnostics shows properties like this one:
Initial Properties:
___ResourcePath = C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib;\Imports;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\Imports;C:\Users\Public\Documents\RAD Studio\7.0\Dcp;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\include;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\lib;C:\Program Files (x86)\Embarcadero\RAD Studio\7.0\Lib\Indy10;

yaws failed to start yet erlang works very well

I downloaded and installed win32 yaws-1.98 installer for my win7 and tried to start it from windows command prompt with: yaws -i. the result I got is just as right below. where I have placed # was a simicolon.
Failed to create the process entirely.
Tried to invoke: erl.exe -pa "C:/Program Files/Yaws-1.98/ebin" -conf "C:\Program Files\Yaws-1.98\yaws.conf" -run yaws -yaws id default #
Make sure you have erl in your environment PATH
after some research, I placed the following paths in the O.S environment variables list separated by semicolon, first under the name ERL_LIBS and then PATH all with no change :
C:\Program Files\erl5.10.3\erts-5.10.3\bin
C:\Program Files\erl5.10.3\bin
what could I be missing
...s.b help.

Where to find the Neo4j shell in v2.0.0-M06

I want to use the Neo4j shell. With the V1.9 release, it was in the bin folder of the installation, but since I upgraded to v2.0.0-M06, I can no longer find it. The bin folder only contains the following files ...
Directory of C:\Program Files\Neo4j Community\bin
16/10/2013 15:38 <DIR> .
16/10/2013 15:38 <DIR> ..
16/10/2013 15:38 37 neo4j-community-user-vmoptions.loc
14/10/2013 09:38 491,016 neo4j-community.exe
16/10/2013 15:38 242 neo4j-community.vmoptions
14/10/2013 09:37 39,564,808 neo4j-desktop-2.0.0-M06.jar
4 File(s) 40,056,103 bytes
2 Dir(s) 16,272,773,120 bytes free
I know I can use the shell in the web UI, but I want to pipe input and output, and I can't figure how to do that except with the stand-alone shell. Any ideas?
I have found the answer - in another question - How to install Neo4j 2.0+ as a windows service .
By downloading the zip file rather than the windows installer, I get all the .bat files, including Neo4jshell.bat. Problem solved!
Try this:
cd C:\Program Files\Neo4j Community
jre\bin\java -cp bin\neo4j-desktop-1.9.4.jar org.neo4j.shell.StartClient [--file /your/file/of/stuff.cyp]

Lua change current/working dir, Linux (without LFS or any non-std modules)

I need to change current working dir in lua script for execute specific actions, but i have a trouble with this simple task.
I write test script test.lua :
os.execute("cd /usr")
os.execute("ls")
But lua test.lua output is:
test.lua
Current dir doesn't change. What's is wrong? And i can't use LFS or any non-std modules.
Thanks to all for explaining it situation. I choose another way : change work dir before run lua script, but i have a lot of troubles with paths which use in scripts and with scripts.
On Unix, os.execute() spawns a child process and its children. In
jpjacobs's answer, the first process would execute the shell.
The directory change operation only affects the child process, not the
process in which the Lua interpreter is executing your program.
It's simply not possible without external libraries. You can use stuff like
os.execute("cd /usr/ && ls")
The Lua standard library is intended to be both small and portable. Therefore, it is based on the capabilities of the C-standard library for all but a select few functions. It has no function to change directories; that's why libraries like LFS exist.
Have you considered that Lua may not be the appropriate language for your needs? If you're doing shell-style scripting work in an environment where you're not allowed to load non-standard modules, perhaps Python or Perl would be better for you. Both of them have extensive standard libraries with a host of features, all without the need to download non-standard modules.
If you want to do any real shell-style scripting in Lua, you need modules. It's that simple. So you should either use external modules or use a different language.
This is a bit of hack, but have you tried creating symbolic links to the folders you need in the current folder, so you don't have to change the current folder at all?
os.execute("ln -s /usr/foo") -- link called "foo" in current dir
os.execute("ln -s /usr/bar") -- link called "bar" in current dir
baz = require('foo.baz') -- loading file /usr/foo/baz.lua
Here is the program written using Zerobranie Lua 5.2:
local sP = "E:/Documents/Lua-Projs/SVN/ScriptsWireE2"
local a, b, c = os.execute("cd "..sP.."&& dir")
print(a,b,c)
And the outpuit:
Програма 'lua.exe' пусната в 'E:\Documents\Lua-Projs\ZeroBraineIDE\ZeroBraineProjects' (pid: 8832).
Volume in drive E is Data
Volume Serial Number is DE34-ED00
Directory of E:\Documents\Lua-Projs\SVN\ScriptsWireE2
08-03-2016 18:25 <DIR> .
08-03-2016 18:25 <DIR> ..
17-03-2016 18:15 <DIR> Bridges
07-03-2016 18:21 11 558 license
07-03-2016 18:21 87 readme.md
2 File(s) 11 645 bytes
3 Dir(s) 181 729 161 216 bytes free
true exit 0
Програмата завършена за 0.06 секунди (pid: 8832).

Windows Server 2003 call to secedit within a batch script generates "C:\Program" on system reboot

In executing
secedit /configure /db %~1\tomcat.sdb" /cfg %~1\2003.inf" /log %~1\dtomcat.log" /quiet
where
%~1 == C:\Program Files\myDirectory\mySubDirectory\mySuperSubDirectory
a file titled "C:\Program" is generated and within the file is the output for calling
secedit /?
I am curious as to why this is occuring because it makes it quite difficult to start certain services after an installation of a new product, for instance a PostGres windows service.
You appear to be missing quotes in a couple of places:
secedit /configure /db "%~1\tomcat.sdb" /cfg "%~1\2003.inf" /log "%~1\dtomcat.log" /quiet
^ ^ ^
You need to enclose the pathname in quotes:
"C:\Program Files\myDirectory\mySubDirectory\mySuperSubDirectory"
The space in "Program Files" is treated as a delimiter.

Resources