Windows cmd file not executing call anymore - windows

I have a cmd file that was working the whole time during my testing and from one minute to the other it doesn't execute my call to another batch file anymore.
The command not working anymore is:
call myfile.bat
Now the only thing that happens at this line is an error: "The provided program can not be executed"
I don't know if it's the exact English version as my system is in German, but it should be like that or similar.
Anyone has an idea why it's not executing my batch file anymore?

virus infection
hard disk crash
insufficient permission
lock by administration
memory leak
unstable power supply
processor overheating
flash of lightning
general failure
unknown reason

myfile.bat got overwritten.
Are you now executing as a different user?

Related

What prevents windows from deleting a file that is in use?

Sometimes I try to delete a file with del /f filenameand it says "The process cannot access the file because it is being used by another process.". Out of curiosity, what exactly is preventing this from happening? Is it the way that the hardware is set up, or is it more on the software side? And if the only thing preventing this from happening is the software, is there a way to work around it (force windows to delete part of the memory that is being accessed, and if it causes an error in whatever process is using it, just let it crash and exit)? Tried to look online and couldn't find anything.
Thanks
If a software program is loading or reading the file you want to delete, then this error appears.
And the only thing you can do, is closing the program and then try to delete the file again..

Windows informs me about returning an error from executable when called from batch job

I call a Windows 7 executable from a windows cmd batch job.
The batch job at the moment is as simple as:
echo on
D:\programs\Process.exe %1>%2
The batch job is started from a python framework.
It works, the %1 is given as args to Process.exe and the output from the process is written to %2.
However, when Process.exe returns an error code (by exit(-3), which is a legal situation), a windows pops up, where I'm informed that there was an error and asks if I want to start debugging.
Can I get rid of that? In case of an error in Process.exe I would like to get that error as a result from the bach job, but most importantly, there shall be no warning window.
Thanks ;-)
Windows machines with some kinds of developer tools installed on them, often give you the opportunity to debug unhandled exceptions or you may be compiling your application to do this (debug mode). Also, if you launch programs from your VS environment, it will definitely give you this pop-up. It should not happen if your application successfully returns a non-zero value. It should only happen if your application failed to handle some kind of critical error or exception.

Is it possible to recover a running VBScript file, if the original file was already deleted?

I have one Vbscript which runs continuously on my system to monitor a web page on Internet Explorer.
I have permanently deleted this Vbscript file from its original location on system by mistake, However the script is still in RAM and is still running and monitoring the web page.
This script is very important to me but I have lost it :(
I want to know if there is any way by which I can recover the code of Vbscript file from system's RAM or any temporary file as the script is still running.
I am not allowed to use any file recovery software, so please don't suggest to install any third party data recovery software.
Try using 'ADPlus.vbs' script from WinDbg:
1. http://msdn.microsoft.com/en-us/windows/hardware/hh852365
2. http://support.microsoft.com/kb/286350
As the code was running, I followed the below process to recover the running code:
Go to Task Manager
Select the process and create dump
Open online dump analyser (www.osronline.com)
Upload dump file
Download the dump analysis
The dump analysis provided almost 95% of the correct code. Code within some loops were distorted or changed. As I was the owner of the code I was able to correct it.
Use HxD, it can view all ram content relative to any process at fly. It is commonly used to hack currently running games etc.
After locating your script, it might be needed to clear alphanumeric mess between your code, N++ and regex knowledge may be useful.

Using VMMap in a batch script

I am doing some analysis work on some software we are running where I work. The software seems to have memory issues some where along the line which are proving difficult to track down. We have decided to use Sysinternals VMMap to track the memory being used by the software.
We have VMMap exporting the usage every 20 seconds using Windows scheduler to launch a batch script which pulls back the target process PID and launches VMMap with it. The process runs for a while, output appearing the out directory but after a while it stops. Windows scheduler reports the job ran fine and will start another instance when the trigger is meant, once again with no output.
After a bit of investigation it looks like VMMap is failing to open the process and is trying to report an error through its GUI. Since we are running in batch, we cannot see this error to dismiss it. This is causing numerous process' to be spawned but not actually doing anything.
Has anyone come across this issue when using VMMap, or know of anything that may help? I am thinking there may be some flag I can pass which suppresses messages or maybe some way I can handle it in the batch but Google hasn't helped nor has the Sysinternals forum. Any help would be really appreciated.
VMMap is a GUI tool, so trying to capture its output in an automated way will be difficult. Instead, try using another SysInternals tool, Handle, that captures a lot of the same information, but exports/reports on it in command line, where it can be captured much easier. Alternatively, don't run the output in an auto-repeating way when using VMMap, but instead have your script somehow detect the error or missing expected results/data and stop so the GUI output can be examined.
All Sysinternals tools do pop up a consent dialog for the first time they are started on a new machine to accept their license. I think you did deploy the tool to a production machine and it was trying to show the consent dialog but nobody did press ok.
They do basically create a registry key on the machine which you can fake if you need a fully automated deployement or you can start in once on the target machine for the user in question.

Write to locked file regardless of lock status

Is there a way to write to a locked file regardless of what program/process has it open?
Scenario:
A commercial product running as a service, locks a log file.
Service can not be stopped because it will impact customers.
Would like to inject a line at the end of the file as a marker.
Getting error: The process cannot access the file because it is being used by another process.
Is there ANY way to append a line on a locked file?
Also, afraid of breaking the lock status, as it may cause the commercial program to break.
Originally thinking batch file until finding out log file is locked. Will do powershell or whatever language can pull this off.
No, the whole idea of the lock(ed) file is that the process that has the lock does not have to worry about other processes modifying the file, so the lock owner does not have to query the file system all the time and can do it's operations much more efficiently.
And see earlier comments by "David Schwartz" and "Ken White"

Resources