Oracle 11g, orapwd.exe do no open - database

when I try to open file orapwd.exe, it opens and immediately shuts down
Also, I tried to open it with admin rights, but nothing changed.
What you could recommend?

It is used to create a password file. Run it from the operating system command prompt; navigate to that directory (to be sure which file you'll actually run). For example:
d:
cd d:\oracle\app\oracle\product\11.2.0\server\bin
orapwd file=orapwSID password=oracle entries=5

Related

How to detect if a perforce session is opened?

I need to detect if a batch file has been executed from the local shell or by double-clicking within P4V. Is there a way I could check if P4V is open?
At first I thought to do it in this way,
but as always, TIMTOWTDI. Any thoughts?
Short answer: no, not really.
Long answer:
You can try to fake it, as you suggest, by checking for a running p4v.exe process. This will only tell you if P4V is open, though. If you had P4V open in another window, and you ran your batch file from a shell (e.g. double clicking in Explorer, or running it from a cmd prompt), you'll get a false positive.
Another approach you might take would be determining whether the script is within a Perforce client workspace. That could potentially be done by having the script run a "p4 where" on its own path to see if it's within the workspace -- but it depends on the script's executing environment having correct connection settings, which depends on the client machine being configured "nicely" (e.g. with P4CONFIG files and/or "p4 set", which are accessible to all Perforce client apps -- if you use P4V exclusively its connection settings won't be readily accessible to your script).

Batch file not working in iis6 window2003

I want to run a batch file that will call openssl.exe to verify signature and after successful verification it will unzip the ziped file. The batch file is working fine manually, but when I call it from classic asp page it is not getting executed.
I have tried everything but it's not executing; it not even showing any message. I'm using a 32bit OS.
Add "Read and execute" permission for files CMD.EXE, OpenSSL.EXE for the user that running your Application pool.

Delete protected registry key with a batch file

Trying to delete the following registry key with a batch file but I can't even delete in the registry editor. Any ideas on how to write a batch file to do it, maybe it need to change permission also.
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\SWD\PRINTENUM\
There are about 8 sub keys under PRINTENUM such as {1974F44D-A278-......} that I want to be deleted.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM
Same as above.
I did try psexec -s -i on the server and having the .reg file on the server too, but just couldn't run it on the client with admin command prompt using \server..... tried all sorts of reg import, to running the reg file with -aaceptuela given me error 0 which should be no errors and error 1 which I tried to login using -u to run it or runas etc.,.,
At the end I had to copy the .reg file and psexec to the local hard drive with the script and ran D:\PsExec.exe -i -s -accepteula reg import "D:\hidden_printers.reg" for it to work.
Thanks again.
First, read the Microsoft support article What are Control Sets? What is CurrentControlSet?.
After doing that it should be clear that whatever is modified under HKLM\SYSTEM\CurrentControlSet is in real done (usually) also on HKLM\SYSTEM\ControlSet001 and applied on next boot also to HKLM\SYSTEM\ControlSet002.
Key HKLM\SYSTEM\Select contains the information which control set is the current control set (usually control set 1), which one is the default control set on Windows boot (also usually control set 1) and which one is the last known good (usally control set 2).
Next read the Microsoft developer network article about HKLM\SYSTEM\CurrentControlSet\Enum Registry Tree.
By default only the SYSTEM account has the necessary permissions to change something in enum registry tree. That can be changed with Regedit.exe, but it is not advisable to do that. Enumerator keys are removed automatically on uninstalling a device with it's driver for example with the Windows device manager. It is not advisable to delete them manually from Windows registry.
It is possible to navigate in Regedit.exe to key HKLM\SYSTEM\CurrentControlSet\Enum\SWD\PRINTENUM, right click on this key, left click on context menu item Permissions, enable full access for group everyone, close the permissions dialog, delete the subkeys, re-open the permissions dialog for the key PRINTENUM again and uncheck full access for everyone to restore the standard permissions. But again, don't do that except you really know what you do.
See super user question Change registry permissions via command line (batch file) containing the answer on your question.

Batch file doesnt run after deploying from SCCM

I have a batch file which uses gpresult /v and saves the output in a text file and copy that text file to a shared folder. This batch when i run on my local machine works perfectly fine but once i deploy it through SCCM it says can not open file with error code 4. I dont know what is wrong in the file.
the code is Like this:
#echo off
gpresult /v >%computername%.txt
xcopy %computername%.txt \some path
Error 4 is "The system cannot open the file.", as if the path is invalid or the open() fails for some other reason.
Do you know what directory the program is running in (CWD)?
That's where the results of gpresult are going (if the output redirection succeeds).
gpresult is not going to produce meaningful user-level data for the SYSTEM user.
Perhaps you should use gpresult /v scope computer.
Why are you using xcopy when you're only copying one file? xcopy really only has added value (over copy) if you are copying directories.
xcopy's behavior changes depending on how you specify the target. If the target ends with the directory separator (backslash), xcopy treats it like it's a directory. If it doesn't and the target doesn't exist, xcopy asks you what to do, which causes automated processes to pause indefinitely waiting for user input.
SCCM Programs Run as 'NT Authority\SYSTEM'
When SCCM (2007) runs a program, the program doesn't run as a regular user. It runs as the highest privilege user (sort of), SYSTEM.
This account is not a regular account, and many settings and environment variables that exist and are predictable for a regular user are different or do not exist for SYSTEM.
One particularly frustrating "feature" of the SYSTEM account's profile is that it is nestled away under %WINDIR%\System32, and so it is subject to filesystem redirection whenever you refer to anything relative to the profile.
Try this: use psexec -s (sysinternals) to get shell access as the SYSTEM account and run the command in that environment to see how it behaves. This is as close as we can get to an environment like the one SCCM programs run under.
When SCCM runs the command, the CWD will probably be somewhere under %WINDIR%\SysWOW64\CCM\ and may be invoked with the 32-bit version of CMD.EXE.
I have a question in regards to something similar to this. So I have an uninstall bat that runs. Due to the vendors uninstall it causes a force close of the windows explorer UI. So in haste to solve that issue I added a call to open explorer.exe. There is a problem with this as someone pointed out to me. Actually as soon as he said I knew exactly what he was saying and where he was going with his statement. Calling explorer.exe would be fine except that the bat is running under the system context not the user so when explorer is restarted it will start under the guise of the system desktop profile not the user's. I know there is way to still run under the guise of system but to restart explorer under the currently logged in user's profile.

batch file ftp authentication issue

I'm trying to download some files using a batch file, however after reading the username line an error is thrown 'Invalid command'.
In my batch file I call my ftp file as follows:
ftp -n -s:ftp_download.txt
my ftp_download.txt looks like this:
open myname.com
test#myname.com
test
lcd C:\myDownloads
cd download_files
get MY_NEW_FILES_*.xml
bye
However after the test#myname.com line an error is thrown 'Invalid command' and thus the script does not connect to my ftp server.
When authenticating as follows:
open myname.com
user test#myname.com test
I get the 'not connected' error
However using this username (test#myname.com) and password (test) I'm still able to connect using Filezilla .
Am I missing a command somewhere?
To those, like CharlesKSQL, who might stumble upon my question.
Here's how I got it to work (it turned out I had to use sftp for some reason so make sure it's enabled on your server);
The script (ftp_download.txt) contains the following:
option batch abort
option confirm off
open sftp://<username>:<password>#<host> -hostkey="<fingerprint/key>"
option transfer binary
cd <your folder>
get <some file>
If you do not know the fingerprint and/or key; you can find these in FileZilla when connecting trough sftp. They are shown in the popup that show up when you connect to your server for the first time or you could click the little lock-icon in the statusbar on the bottom right when you are connected already.
Now to actually connect you'll need a little bit of software (when using Windows) to create the secure connection. I used WinSCP.
You can download the portable executables here and place them (for easy usage) in the same folder as your batch file.
Then you can call the executable in your batch file by adding a parameter:
winscp.exe /script=ftp_download.txt
which should then execute your download script.
P.S.: it's been a while since I finished this, it's still working as far as I know.
Your text file should look like this:
open myname.com
user
<enter username here> <password here>
lcd C:\myDownloads
cd download_files
get MY_NEW_FILES_*.xml
bye
Try that and see if it helps

Resources