I don't know why, but if you run a batch file as administrator and it attempts to run something using the start command, it says that it can't find it, even though its in the location. Is there a work around this?
Then the fix was successful, because the script was found. This is another problem, most likely with your use of the "start" command. I would just execute it with WScript or CScript instead unless you really need to use start.
Sort of going out on a limb here for lack of detail....
However, whatever you are trying to start may have its startup type set as "disabled". Won't be able to start. However, my question is then why would that be reported as "can't find it"......
Are you able to post what service/process you are trying to start, your batch file, and the error message being returned?
Sort of going out on a limb here for lack of detail....
However, whatever you are trying to start may have its startup type set as "disabled". Won't be able to start. However, my question is then why would that be reported as "can't find it"......
Are you able to post what service/process you are trying to start, your batch file, and the error message being returned?
That information could be helpful.
I'm trying to make it run a .vbs script file. It's in the same folder as the batch file, and whenever I run the batch file as admin and it attempts to run the file, it says it cannot find it. It runs normally with no administrator mode ran, however I require to have it run as admin for my software I'm coding. It just says like "Windows cannot find the file "file"" you know, the regular standard normal error message you would usually get if you were to attempt to have cmd or batch run something and you put the wrong destination. I did run command prompt as admin and attempted to run the vbs file with it and it worked. However it didn't work with a batch file, like so.
I'm trying to make it run a .vbs script file. It's in the same folder as the batch file, and whenever I run the batch file as admin and it attempts to run the file, it says it cannot find it.
By default, when you run the batch file as admin it creates a new session for the command prompt and sets the working directory to "%SystemRoot%\system32", which is typically "C:\Windows\system32". Just open a new command prompt as admin and you'll see that is the case. If you want the directory of the batch file, change the directory to "%~dp0" using either "cd %~dp0" or "pushd %~dp0" (if you want to go back and forward between directories, learn to use pushd and popd).
Not sure which may be applicable to your requirements....
It's a batch file that will delete certain Windows Updates for me. When I delete the updates, I like to make a restore point, so the vbs script I mentioned makes one automatically for me. So when the batch file deletes the updates, before it does, it'll run the script that makes a restore point then it will delete the updates. so it just pretty much attempts to run automatically when the batch file is executed.
Are you able to post your script? Comment each section as appropriate and be sure to indicate where the error occurs.
Where you "are", where the script "is", and where the system "is" could be three different places. And thus the file "cannot be found".
Script is in the same folder as the batch file. so i dont have to put any directories on the start command
It's not a problem with the script, its with any file that the batch file attempts to run. and as i already said, when i run the batch file, it automatically attempts to execute the start command and the file so its in the beginning, when i automatically get the error.
I tried doing the quote thing like you mentioned, but that didn't seem to work. All that did was open up Command Prompt as administrator in another window.
What I did:
start "createrestorepoint.vbs"
If that's what you meant with the quotes
i also did start "" "createrestorepoint.vbs"
returns same error message with that one.
May be going off topic a bit as I am not sure if you just need to get it done or need to use .vbs per se.
In anycase Powershell is quite potent - so much to learn. And I am not one to reinvent the wheel and will look for solutions that I can modify or otherwise tweak to my purposes. Hence the links....
May be going off topic a bit as I am not sure if you just need to get it done or need to use .vbs per se.
In anycase Powershell is quite potent - so much to learn. And I am not one to reinvent the wheel and will look for solutions that I can modify or otherwise tweak to my purposes. Hence the links....
Windows 8.1 Pro 64-bit
I just used the command that you told me to use but used PowerShell instead of PS as the beginning command
I'm aware that you can delete update files as well from windows update and other ways, but i'd prefer doing them over a batch file to save me some time, other than have to go clicking around typing in all the updates into windows update and deleting them
You are overcomplicating this. The problem is trivial to fix. My previous post explained why you're receiving this message and included a solution (with the caveat that I'm going off the symptoms, as you haven't posted the script).
You are overcomplicating this. The problem is trivial to fix. My previous post explained why you're receiving this message and included a solution (with the caveat that I'm going off the symptoms, as you haven't posted the script).
If you set up a PowerShell script file with the necessary cmdlets then that script will do all the work.
In agreement with Randomizer's comment. And, as for myself, without the script I am not really sure about the bigger picture and the end objective(s).
Clicking around as in going to the start menu, typing in Windows Update, clicking on windows update, clicking on the search bar, typing in the update, click on the update, right click on the update and click delete and click ok. batch files can save you lots of time with tasks.
If you REALLY need the script, then download it, which the link is above.
This isn't the only batch file that won't read a file that i put on the start command. this isnt my computer, not my batch file, it's just something wrong with the cmd that microsoft doesnt fix, or for some apparent reason, it isnt fixable. this happens to every batch file. you run it as administrator, in whatever area the batch file attempts to run a file using the start command, says "Windows cannot find the file. Make sure you typed its name correctly, and try again"