Page 1 of 1 1
Topic Options
#32243 - 2002-11-12 03:10 PM Deleting a directory named %WinDir%
kncowans Offline
Getting the hang of it

Registered: 2000-11-11
Posts: 98
Loc: Doncaster, UK
Hello all

For some reason, a directory named %WinDir% has appeared on all of my client machines with a blank text file inside it.

Obviously I am unable to delete this directory using the Del C:\%WinDir% command but how would I accomplish this?

Thanks in advance
_________________________
Kevin Cowans Senior ICT Technician The Armthorpe School

Top
#32244 - 2002-11-12 03:15 PM Re: Deleting a directory named %WinDir%
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Try replacing the '%' sign with it's ASCII code like
code:
if exist('c:\'+chr(37)+'WINDIR'+chr(37))
del 'c:\'+chr(37)+'WINDIR'+chr(37)
endif

Alternatively, temporarily point the environment variable %WINDIR% to the real folder C:\%WINDIR%, delete the folder and the repoint %WINDIR% to the correct Windows directory.

However, the question is, why has the folder been created in the first place?
_________________________
There are two types of vessels, submarines and targets.

Top
#32245 - 2002-11-12 03:24 PM Re: Deleting a directory named %WinDir%
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
At a DOS prompt or batch file:
code:
DEL %%WINDIR%%\blankfile.txt
RD %%WINDIR%%

Use a similar syntax in KiXtart - using "%%" cancels the special meaning of "%".

Top
#32246 - 2002-11-12 03:42 PM Re: Deleting a directory named %WinDir%
kncowans Offline
Getting the hang of it

Registered: 2000-11-11
Posts: 98
Loc: Doncaster, UK
Hello

Thanks for the replies, however, none of the above solutions work.

Any more suggestions?

Thanks in advance

Kevin
_________________________
Kevin Cowans Senior ICT Technician The Armthorpe School

Top
#32247 - 2002-11-12 03:51 PM Re: Deleting a directory named %WinDir%
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Go to one of the affected computers and check the permissions. Then try to manually delete the folder through the Windows Explorer. Then try to delete such a folder form the command line.
_________________________
There are two types of vessels, submarines and targets.

Top
#32248 - 2002-11-12 03:54 PM Re: Deleting a directory named %WinDir%
kncowans Offline
Getting the hang of it

Registered: 2000-11-11
Posts: 98
Loc: Doncaster, UK
Hello

All of the machines with this directory are Windows '98SE.

I can delete the directory if I right click and select delete.

Thanks in advance

Kevin
_________________________
Kevin Cowans Senior ICT Technician The Armthorpe School

Top
#32249 - 2002-11-12 03:55 PM Re: Deleting a directory named %WinDir%
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Is this Windows NT or Windows 9x?

Brian

Top
#32250 - 2002-11-12 03:59 PM Re: Deleting a directory named %WinDir%
kncowans Offline
Getting the hang of it

Registered: 2000-11-11
Posts: 98
Loc: Doncaster, UK
Hello

These are Windows '98SE machines.

Thanks in advance

Kevin
_________________________
Kevin Cowans Senior ICT Technician The Armthorpe School

Top
#32251 - 2002-11-12 04:28 PM Re: Deleting a directory named %WinDir%
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
quote:
Thanks for the replies, however, none of the above solutions work.
Eh? Are you sure?

What error messages are you getting back when it doesn't work?

I've just tried it on a Win95 machine:
code:
md c:\%%WINDIR%%

Creates the directory, and
code:
rd c:\%%WINDIR%%

removes it.
You will need to remove the file from the directory before attempting to delete the directory itself, but other than that it should work.

[ 12. November 2002, 16:31: Message edited by: Richard Howarth ]

Top
#32252 - 2002-11-12 04:36 PM Re: Deleting a directory named %WinDir%
kncowans Offline
Getting the hang of it

Registered: 2000-11-11
Posts: 98
Loc: Doncaster, UK
Hello

I have just tried it again and that worked, thanks.

Bye for now

Kevin
_________________________
Kevin Cowans Senior ICT Technician The Armthorpe School

Top
#32253 - 2002-11-12 04:37 PM Re: Deleting a directory named %WinDir%
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Maybe attributes on file or folder? Try DelTree.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.133 seconds in which 0.065 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org