Can't Create a Batch File that's Executable

  • Thread starter Thread starter Paul Calcagno
  • Start date Start date
P

Paul Calcagno

I'm running Windows Home Premium, SP2. Windows Defender, Spyware Doctor,
MBAM, SAS and CCleaner. MS Office 2007. 2 GB of RAM. All WU's are current.
System is running fine.

I'm having trouble with Win Defender Definitions updates so I'm working via
e-mail with MS to reset my Security Settings and Permissions. One of their
suggestions is to create a batch file using Run==>Cmd==notepad and have this
file contain the following:

@echo off

subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=system=f

@Echo =========================
@Echo Finished.
@Echo =========================
@pause
Now I'm having trouble saving this file as a batch file so that I can double
click it to make it run under a Dos application. If saved correctly, I'm
supposed to be able to double left click it or right click it and select
`Run As Administrator'. No matter what I call it (reset.bat, reset.txt) or
no matter what file type I save is as, when I double click it, it won't
`run' or when I right click it, Run as Administrator is not an option. Am I
doing something wrong? Paul C.

Any help would be greatly appreciated. Do I have a virus and that's why
these files are behaving this way? I've waisted hours on this meaningless
problem.

Paul C.
 
Paul said:
I'm running Windows Home Premium, SP2. Windows Defender, Spyware
Doctor, MBAM, SAS and CCleaner. MS Office 2007. 2 GB of RAM. All
WU's are current. System is running fine.

I'm having trouble with Win Defender Definitions updates so I'm
working via e-mail with MS to reset my Security Settings and
Permissions. One of their suggestions is to create a batch file
using Run==>Cmd==notepad and have this file contain the following:

@echo off

subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=system=f

@Echo =========================
@Echo Finished.
@Echo =========================
@pause

Now I'm having trouble saving this file as a batch file so that I
can double click it to make it run under a Dos application. If
saved correctly, I'm supposed to be able to double left click it or
right click it and select `Run As Administrator'. No matter what I
call it (reset.bat, reset.txt) or no matter what file type I save
is as, when I double click it, it won't `run' or when I right click
it, Run as Administrator is not an option. Am I doing something
wrong? Paul C.
Any help would be greatly appreciated. Do I have a virus and that's
why these files are behaving this way? I've waisted hours on this
meaningless problem.

Seems you are being told to do this:
"Advanced Troubleshooting" titled,
"Method 1: Reset the registry and the file permissions"
http://support.microsoft.com/kb/949377
Correct?

But you never mentioned getting/installing SUBINACL...

Download and then install the Subinacl.exe file. To do this, visit the
following Microsoft Web site:
http://www.microsoft.com/downloads/details.aspx?FamilyID=e8ba3e56-d8fe-4a91-93cf-ed6985e3927b

Without that step - the rest will fail. After installing that - continue.

Create your document as you have shown, but add this as the first line:

cd /d "%ProgramFiles%\Windows Resource Kits\Tools"

If you save it as reset.cmd (in notepad by clicking FILE --> SAVE AS -->
Save In: "Local Disk (C:)" --> File name: "reset.cmd" --> Save as type: "All
Files" --> Encoding: ANSI --> click on the "SAVE" button then FILE --> EXIT)
at the root of your C drive and then do the following...

Start button --> RUN --> type in:
cmd /k dir c:\reset*.*
--> click OK

What does the resultant directory listing show?

If it shows something like:

" Volume in drive C has no label.
Volume Serial Number is ____-____

Directory of c:\

__/__/____ __:__ __ 476 reset.cmd
1 File(s) 476 bytes"

Type in EXIT at the command prompt.

Then you could could check the file associations - where CMD and BAT should
*not* be listed. If they are - they may be associated with whatever you
used to open/edit them - and there is your issue. Need to not have that
association. Most likely - you are fine - move on...

Now - what happens when you try to run it with right-click --> Run As
Administrator?


One might have you try this:
How do I reset Windows Update components?
http://support.microsoft.com/kb/971058
.... if you are running a 32-bit version of Windows Vista.
 
Shenan. Thanks so much for your detailed directions.

I believe I got the batch file created successfully by adding that one line
of code you suggested in the notepad file and then saving it per your
instructions. In file, properties it shows as a Windows Command Script file
with a little gear-type logo on it.

I forgot to mention to you the last time that I had already downloaded that
subinacl file.

Now when I double clicked the new notebook file the dos engine started up
and took about 20 minutes to complete going thru all my registry
information.

Also, now when I right click on the notepad file I have the option of
running as an administrator.

So now my question is, if this script did indeed reset my registry and file
permissions, can I now try to download the latest Win Defender Definitions?
(which are, at the moment, NOT being offered to me). Also, if I have this
problem again of downloading the same definitions files do I just run this
notepad script file again or what? And why the hell are my permissions all
of a sudden getting screwed up?

Should I wait for the Win Defender definitions file to be offered again or
should I try to go back to that website
(http://www.microsoft.com/security/portal/default.aspx) and download them
`manually'. I only ask this because the latest Win Defender Definitions
file I have is KB915597 (1.81.0.0) and the later one that's failed 3 times,
and is not longer being offered, is KB915597 (1.81.149.0).

Thanks again for your expertise..........Paul C.
 
Shenan, maybe you could tell me a little more about your other suggestion
of `How do I reset Windows Update components?
(http://support.microsoft.com/kb/971058.

Reading a little bit on this site and it seems to pertain to not being able
to download SP3 for Win XP so I'm a little confused. Further on it says
`This article helps you reset the Windows Update components'. Why do I need
to do this? Does this fix have something to do with how Updates will be
offered to me? And if I need it can I just click the link to `Fix this
Problem' MS Fix It 50202'?

Thanks..............Paul C.
 
Paul said:
Shenan, maybe you could tell me a little more about your other
suggestion of `How do I reset Windows Update components?
(http://support.microsoft.com/kb/971058.

Reading a little bit on this site and it seems to pertain to not
being able to download SP3 for Win XP so I'm a little confused. Further on
it says `This article helps you reset the Windows Update
components'. Why do I need to do this? Does this fix have
something to do with how Updates will be offered to me? And if I
need it can I just click the link to `Fix this Problem' MS Fix It
50202'?
Thanks..............Paul C.

First - I pointed you to http://support.microsoft.com/kb/949377 because that
is what you said Microsoft was having you do (at least the advanced method I
directed you to within that full document.) Why were they having you do
that? My guess was to make sure you had the proper permissions set on your
registry keys and files and folders to allow you to do everything you might
need. Malware has been known to change such things and make it harder for
you to repair things.

Second - I pointed you to http://support.microsoft.com/kb/971058 because it
is an easy way for you to reset your Update system - more automated. If you
cannot update something related to Microsoft - perhaps the automated Fix It
they provide will re-register the correct DLLs and such and get you moving
again. I would say running it will not hurt anything for you and I would
recommend it after you have fix the permissions on your
registry/file/folders.

The mention of Windows XP SP3 in the first article is because that *is* what
that article happens to center around, but the advanced method I pointed you
to (as did Microsoft) works in Windows Vista as well - ensuring proper
permissions/access that you may need.

The second article does not mention Windows XP SP3 that I recall. It does
apply to several different OSes (as seen at the bottom of the article:)

a.. Microsoft Windows XP Home Edition
a.. Microsoft Windows XP Professional
a.. Windows Vista Business
a.. Windows Vista Enterprise
a.. Windows Vista Home Basic
a.. Windows Vista Home Premium
a.. Windows Vista Ultimate
a.. Windows Server 2008 Datacenter
a.. Windows Server 2008 Enterprise
a.. Windows Server 2008 Standard
a.. Microsoft Windows Server 2003, Web Edition
a.. Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
a.. Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
a.. Microsoft Windows Server 2003, Standard Edition (32-bit x86)

Hope that helps!
 
Thanks for your comments, Dave.

Turns out I only have Spyware Doctor running realtime. MBAM and SAS have
always been used in the on-demand mode. Furthermore, with this AV
configuration I've never had any issue just clicking `Install' with Spyware
Doctor enabled before. All of a sudden, the installation starts failing.

Paul C.
 
Back
Top