Error Executing Batch file of BlazeDS - batch-file

I'm trying to see samples of BlazeDs in my web brower as shown in the tutorial on this webpage.
After I have started tomcat i open the localhost link 8400/samples in my browser as shown below.After entering the url i get the following page in my browser..
After that i try to start the sample database according to the instructions given in a box at the starting of the webpage. After i run the specified command on my command prompt i get the following error message..
I can't seem to understand the error.Even though i have set the JAVA_HOME variable as follows still i am getting this error..
Is this error due to firewall problem? or something else??
Please Help..

java is not an internal command of cmd.exe.
As this command is without file extension and without full path, Windows searches first in current directory C:\blazeds\sampledb for java.* to find either java.com, java.exe, java.bat, java.cmd and some other file extensions.
The file extensions are defined in environment variable PATHEXT separated by semicolons which can be viewed in a command prompt window with command set PATHEXT
If there is no such file with file name java in current directory, Windows searches in all directories specified separated by semicolons in environment variable PATH. Entering just path or set path in a command prompt window results in a display of those directories. (set path lists the directories of PATH and the file extensions of PATHEXT as both environment variables start with the string "path".)
The environment variable JAVA_HOME is needed perhaps by the Java package itself and other applications, but is definitely not read by Windows to find an executable file with name java.
Search for the directory containing java.exe and append the directory of this file to PATH. On command line this can be done with:
PATH=%PATH%;Full path to directory containing java
Do not enter double quotes even if the full path to directory containing java.exe contains 1 or more space characters.
Or you run the java application with the command line
"Full path to directory\java.exe" -cp hsqldb.jar org.hsqldb.Server

Related

Command Line Installation with SCCM 2012

I have a few applications that I am trying to deploy with SCCM 2012 but the installations are failing through the application catalog. So what I have for the deployment type is a script installer. I have "cmd.exe" (Without quotations) in the Installation program field and "Installer.bat" in the installation start in field.
When I look at the ccmcache folder, all the contents over that application are there but the following error displays the Software Center:
0x8007010B(-217024629)
I have done some reading online and the "10B" is a common command line error for invalid directory. I have tested the batch file when hard coding a path but my question is, how can I edit the batch file or SCCM to pull from the CCMCache path where the files are downloaded to on the local client? Currently the Batch File is simply:
#echo off
ApplicationName.exe
Do I need to edit the file to cd into the CCMCache folder where the files are placed? How can I get the batch file to run the executable that is downloaded to the CCMCache folder?
Thank You!
You need to have the full path to the installation in your script
#echo Off
\\path to .exe
The way the command is written will not be able to find the .exe file. You need to add the full unc path to the .exe into your .cmd file. You should have your installation .exe and .cmd file in the same location on the distribution share
Recommended Solution:
Before starting, since you are only launching an exe with your batch file, I would recommend just using your ApplicationName.exe as your command line parameter in SCCM instead of using a batch. This will eliminate the need to engineer any further.
Modifying the existing solution to work:
If you do still want to use a batch file, keep a few things in mind. The syntax you are using to launch the batch file will not work. I would recommend just using the batch file name "installer.bat" as your command line. If you still want to preface the batch with the cmd.exe, you absolutely need to use the /c switch with it
cmd.exe /c installer.bat
If you don't use /c the console host will only open to a promopt and not execute your batch.
This is not an ideal solution though because using "cmd.exe /c" will set your working directory to the location of cmd.exe (ie "C:\windows\system32") and since your content is staged in ccmcache, you will need to specify its location within your batch. To do this, you would use %~dp0 variable which gives you the directory the current batch is running from. This means modifying your batch to read
#echo off
%~dp0ApplicationName.exe

Can't run program after set path as environment variable

I have set a new environment variable pointing to msbuild.exe folder.
C:\temp\Test>echo %DOT_NET4%
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Now, if I start a new cmd and run "msbuild.exe", the programs runs ok, but after running this simple bat, the program is not found anymore:
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %CHECKOUT% %PATH%
cd %PATH%
nuget restore OpenText.sln
msbuild.exe OpenText.sln
msbuild not recognized as an internal or external command.
Thanks in advance
I am seeing the same thing as Joey in his comment. Your use of CD %PATH% is a red flag that indicates a problem.
PATH is a critical environment variable that contains a delimited list of folder paths where important executables are located. The command processor uses that list to locate programs when an external command is issued without the full path to the command.
If PATH is set correctly, then your command CD %PATH% cannot work. But I suspect you have some script that defines PATH to a specific folder, perhaps where nuget is located. In this case, your CD %PATH% command works, but now cmd.exe has no idea where msbuild.exe is located.
Moral of the story - don't ever use PATH for your own purposes. Pick some other variable name that is not reserved.
First things first, where are you setting the msbuild path? To resolve your issues, please check if you have followed this process:
Open your system control panel, check for advanced system settings.
Click on Environment variables and edit PATH
Add a semicolon followed by the msbuild path.
Open a new command prompt and check if it is working or not.
Please note if you set msbuild in one command prompt, it will not be available in another command prompt.
Another issue which I see when I look at your logic is, you are trying to cd to %PATH% which should be avoided, you are either resetting the Environment variable path to a new path and trying to cd to it or you will land up file name longer issues, please use another variable instead.
In the bat which you are invoking, add a condition at the root level, such that if msbuild is not found, basing on %ERRORLEVEL%, try adding msbuild to path again at batch level, so that you build will proceed.

Include credentials of shared folder in WinSCP script file

In order to access a remote shared folder, I need to indicate the username and password. However, I have no idea where to put it in my WinSCP code.
open ftps://ftpuser:password#hostname/ -explicit -certificate="key"
cd Results
lcd \\networkname\sharedfolder\folder\
put *
This produces an error which is:
Error changing directory to '...'.
Any idea? Thanks
The error "Error changing directory", which you are getting is most probably caused by the lcd command. In Windows, the current working directory cannot be an UNC path (the \\networkname).
Instead of changing the current working directory, upload the file using a full path:
open ftps://ftpuser:password#hostname/ -explicit -certificate="key"
cd Results
put \\networkname\sharedfolder\folder\*
However if you actually need credentials for accessing the UNC path (the \\networkname), you have to authenticate prior to running the WinSCP script.
The batch file will be like:
net use \\networkname\sharedfolder password /user:domain\username /savecred /p:yes
winscp.com /script=... /log=...
net use \\networkname\sharedfolder /delete
Credits: How to create MAP Drive by batch file.
You still need to use the full path with the put command, instead of the lcd though. Unless you map the UNC path to a drive letter.

batch file command line start in same folder as executable on network path

I know from a desktop I can have a bat file that runs an executable with specific parameters and starts in the same path on the network where the executable exists, but how can I accomplish the same thing when calling the bat file assuming is in same folder as executable from another application?
For example:
\My-Network\app\PR8.exe /noload
I want to start specifically in \My-Network\app (same folder where PR8.exe exists) but not where it defaults to which seems to be c:\windows somehow. I can't seem to do a cd on a UNC path and I don't want to use any path letters as the application also detects as to which server it is executing from as well.
It isn't possible to set a UNC working directory for Windows batch files without network mapping drives. However, in Windows 2000 and later, you can use the PUSHD and POPD commands to change the working directory to a UNC share when running your script.
Wikipedia gives us the example of creating a shortcut to your batch file where the Target is set to the following:
%COMSPEC% /E:ON /C "PUSHD """\\My-Network\app\""" & C:\PATH\TO\BATCHFILE.BAT & POPD"
In this case the Working directory attribute of the shortcut is ignored, as the PUSHD and POPD commands will change it to the path specified.

System cannot find the file specified while copying through CMD

In my C program, I execute a system command to copy files from my downloads folder to a folder in desktop, the program works on .mp3 files.
The problem is that my program copies all the .mp3 files successfully from other folders except a specific folder for a reason I don't know why. I Checked the command being executed and it shows no syntax or file name errors.
The command that causes (system cannot find the file specified) error:
system("copy \"C:\\Users\\Mac\\Downloads\\test\\01 Andrew Bayer - Counting The Points.mp3\"
\"c:\\users\\Mac\\desktop\\AVB\"");
Please help me to spot the reason that causes this error in spite that the file name and path of the file is correct, and only the files in this folder(test) causes this error.
Note:
The files I'm trying to copy are downloaded from a torrent, if this may help.
A few thoughts:
Perhaps the path to your file is too long. Try to copy the folder to the root of your disk and retry the command. Or use subst to connect a drive letter to a path.
There could be an issue with NTFS rights. Go to the security settings of the Downloads folder. Check the permissions and enable the checkbox option to replace security on all subfolders and files (remove explicitly set permissons of the child items).
Try renaming the file to A.mp3, I'm not sure if it is possible, but the file name could contain weird unicode characters?

Resources