Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > Can't Create a Batch File that's Executable

Reply
Thread Tools Display Modes

Can't Create a Batch File that's Executable

 
 
Paul Calcagno
Guest
Posts: n/a

 
      04-25-2010
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.



 
Reply With Quote
 
 
 
 
Shenan Stanley
Guest
Posts: n/a

 
      04-26-2010
Paul Calcagno wrote:
> 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/d...f-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 Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html


 
Reply With Quote
 
Paul Calcagno
Guest
Posts: n/a

 
      04-26-2010
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 Stanley" <> wrote in message
news:...
> Paul Calcagno wrote:
>> 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/d...f-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 Stanley
> MS-MVP
> --
> How To Ask Questions The Smart Way
> http://www.catb.org/~esr/faqs/smart-questions.html
>

 
Reply With Quote
 
Paul Calcagno
Guest
Posts: n/a

 
      04-26-2010
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.

"Shenan Stanley" <> wrote in message
news:...
> Paul Calcagno wrote:
>> 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/d...f-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 Stanley
> MS-MVP
> --
> How To Ask Questions The Smart Way
> http://www.catb.org/~esr/faqs/smart-questions.html
>

 
Reply With Quote
 
Shenan Stanley
Guest
Posts: n/a

 
      04-26-2010
Paul Calcagno wrote:
> 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!

--
Shenan Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html


 
Reply With Quote
 
Paul Calcagno
Guest
Posts: n/a

 
      04-26-2010
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.

"Dave-UK" <> wrote in message
news:A5-dnZxyAIbD6EjWnZ2dnUVZ8n-...
>
> "Paul Calcagno" <> wrote in message
> news:...
>> 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.
>>

>
> I suspect that your original problem with Defender updates may be
> because you have too many security programs running at once.
> There may be some sort of conflict happening.
> Try removing Spyware Doctor, SAS and only run Malwarebytes on demand
> to see if that helps.
> It seems that whoever gave you the advice to run the batch file didn't
> realise you were running Vista. Administrators have different privilege
> levels in XP and Vista.
> By running the line:
> 'subinacl /subdirectories %SystemDrive% /grant=administrators=f'
> you have effectively reduced some of Vista's security.
> If I understand it correctly that line gives administrators full control
> of all files on the system drive (C:\) including Windows, System32, Winsxs
> etc.
> In Vista only TrustedInstaller should have full control.
> The standard Vista permissions for system files are:
> TrustedInstaller: Full Control
> System: Read and Execute
> administrators: Read and Execute
> Users: Read and Execute
> By giving members of the administrators group full control to system files
> it
> is likely that any malware process that manages to run with administrator
> privileges will now be able to delete, rename or modify etc. Windows
> system files.
> I may have got it wrong about subinacl but I don't think so. :-(
>
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error code 0x8024D007 jenny Windows Update 10 11-23-2009 05:48 PM
chkdsk : NTFS on Vista x64 Nigel Windows Vista File Management 5 06-02-2008 02:02 PM
File not in Explorer but opens anyhow Toyman Windows Vista File Management 5 07-24-2007 11:06 PM
mmc.exe error, cannot run. olouvignes Windows Vista Installation 4 04-18-2007 02:40 PM
Can't create a new file or folder with in a shared folder on a Windows XP machine. Basic Vista networking questions Nate Goulet Windows Vista Installation 4 04-18-2007 09:20 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59