MSFN Forum: (SOLVED) sharing violation reading drive c - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

(SOLVED) sharing violation reading drive c trying to create a batch script. No idea ? I'm doing Rate Topic: -----

#1 User is offline   PROBLEMCHYLD 

  • The Resurrector for old Windows OS
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,470
  • Joined: 07-October 05
  • OS:98SE
  • Country: Country Flag

Posted 17 May 2012 - 06:26 PM

I know nothing about batch files.
I tried to put together this script, and not sure why things isn't working.
attrib.exe -h %windir%\shelli~1
del %windir%\shelli~1
attrib.exe -h %windir%\ttfcache
del %windir%\ttfcache
if not exist %windir%\inf\tweakui.inf del %windir%\system\tweakui.cpl
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\Program Files\Common Files\Microsoft Shared\Replman
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\Program Files\Common Files\System\Comp

This post has been edited by PROBLEMCHYLD: 21 May 2012 - 08:33 AM



#2 User is offline   dencorso 

  • Adiuvat plus qui nihil obstat
  • Group: Super Moderator
  • Posts: 4,866
  • Joined: 07-April 07
  • OS:98SE
  • Country: Country Flag

Posted 18 May 2012 - 12:10 AM

View PostPROBLEMCHYLD, on 17 May 2012 - 06:26 PM, said:

I know nothing about batch files.
I tried to put together this script, and not sure why things isn't working.

One possibility is that you might have to use double quotes around the path/filename containing spaces... Do give my modified version below a try and report.

attrib.exe -h %windir%\shelli~1
del %windir%\shelli~1
attrib.exe -h %windir%\ttfcache
del %windir%\ttfcache
if not exist %windir%\inf\tweakui.inf del %windir%\system\tweakui.cpl
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\"Program Files\Common Files\Microsoft Shared\Replman"
RUNDLL32.EXE ADVPACK.DLL,DelNodeRunDLL32 %24%\"Program Files\Common Files\System\Comp"


#3 User is offline   Geej 

  • Senior Member
  • PipPipPipPip
  • Group: Members
  • Posts: 634
  • Joined: 01-January 08
  • OS:XP Pro x86
  • Country: Country Flag

Posted 18 May 2012 - 02:53 AM

PROBLEMCHYLD, it would be more useful if you were to indicate which line is giving you problem and what os it is running on.

Off my head, shelli~1 and ttfcache looks like folder. Perhaps you could replace del with rd.
%24% is use by inf, not sure if cmd shell will parse the variable correctly if run via batch.
Try replace with %systemdrive% (better still, change the entire rundll.exe ... to rd /q ...)
If path contain space, double quote it

This post has been edited by Geej: 18 May 2012 - 03:17 AM


#4 User is offline   PROBLEMCHYLD 

  • The Resurrector for old Windows OS
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,470
  • Joined: 07-October 05
  • OS:98SE
  • Country: Country Flag

Posted 18 May 2012 - 07:15 AM

View Postdencorso, on 18 May 2012 - 12:10 AM, said:

One possibility is that you might have to use double quotes around the path/filename containing spaces... Do give my modified version below a try and report.
I'll give it a shot. Thanks

View PostGeej, on 18 May 2012 - 02:53 AM, said:

Off my head, shelli~1 and ttfcache looks like folder.
They are actually files.

#5 User is offline   jaclaz 

  • The Finder
  • Group: Developers
  • Posts: 11,433
  • Joined: 23-July 04
  • OS:none specified
  • Country: Country Flag

Posted 21 May 2012 - 07:56 AM

For the record, I just got confirmation that the issue was this one:
http://ss64.com/nt/attrib.html

Quote

Hidden and System attributes take priority.

If a file has both the Hidden and System attributes set, you can clear both attributes only with a single ATTRIB command.

For example, to clear the Hidden and System attributes for the RECORD.TXT file, you would type:
ATTRIB -S -H RECORD.TXT

(suggested to OP via PM as something to try and now reported as having solved the issue)

jaclaz

This post has been edited by jaclaz: 21 May 2012 - 07:57 AM


#6 User is online   Yzöwl 

  • Wise Owl
  • Group: Super Moderator
  • Posts: 4,364
  • Joined: 13-October 04
  • OS:Windows 7 x64

Posted 21 May 2012 - 01:22 PM

Changing the attributes shouldn't be necessary when deleting files. The first four lines given could have been replaced with the following single line:
DEL /A  "%WINDIR%\SHELLI~1" "%WINDIR%\TTFCACHE"


Also have you considered the DELTREE command?

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy