Any way I can start a file in a batch file when running it as administrator?

Page 2 - Seeking answers? Join the Tom's Guide community: where nearly two million members share solutions and discuss the latest tech.

ChaoticWolf

Estimable
Feb 2, 2016
61
0
4,610
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?
 
Solution
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.
Thank you.

I looked at the script and had to get some very old gears going....

Curious about the Sub CreateSRP

Specifically:

GetObject("winmgmts:\\.\root\default:Systemrestore").CreateRestorePoint "Instant Restore Point", 0, 100

I am not sure about the period after the first closing parenthesis mark and everything thereafter sort of just hung out there - especially the 100

Sort of felt that something was not right so I for lack of memory did some googling and found this:

http://superuser.com/questions/994854/why-the-create-restore-point-script-work-differently-on-windows-7-and-on-windo

As I read the article (apparently via how-to-geek) and understand the script, there just seems to be something astray with respect to syntax.

In all fairness I may be missing something or have otherwise forgotten something.

Still felt it best to pass along just as a matter of elimination if anything.

 

ChaoticWolf

Estimable
Feb 2, 2016
61
0
4,610


But I don't get it. It can't be that the batch file doesn't run the script because there is some odd code in the script, because this happens to ANY type of file that it tries to run as administrator with the start command. It's really weird and annoying.
And I'm sorry if I'm making things complicated and don't really understand you all that much, I'm very good with batch coding and script coding and all that stuff with Windows but not THAT much to the point where I can fix any errors I encounter SNAP.
I hate to waste your time bothering you

By the way, I didn't make that script. I just downloaded it off a website so that I can use it.
If you can, try and make a batch file and put in the start command and put a file that you want to run with it, save it, and run as administrator. see if you get the error.
 

ChaoticWolf

Estimable
Feb 2, 2016
61
0
4,610


Sure, here you go: http://www.mediafire.com/download/qykm800b636897l/Remove+Updates.zip

Make sure you view the code contained inside it before running it

Also, if you decide to run it, RUN AS ADMINISTRATOR, to see if you get the error as well

 

ChaoticWolf

Estimable
Feb 2, 2016
61
0
4,610


Didn't work. Just said it can't find "C:\Users\Windows" or something like that
 

ChaoticWolf

Estimable
Feb 2, 2016
61
0
4,610


That just opens CMD up as administrator in another window
 

randomizer

Distinguished
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.
 
Solution