There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Windows NT/2000/XP
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > Windows NT/2000/XP >
Cannot delete a folder I stupidly named "."


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
chuckeee's Avatar
Junior Member with 9 posts.
 
Join Date: May 2007
12-Jul-2008, 09:39 PM #1
Cannot delete a folder I stupidly named "."
Hi,
I wrote a VBScript file that mistakenly created a folder called "."

Now, when I try to delete it, Windows XP says:
"Cannot delete file: Cannot read from the source file or disk".

Could it be reporting this because I named the folder this particular name? (It has the same name as the convention for the current directory you are in when you are working at the command prompt).
Windows doesn't allow folders called "." to be created normally, so how can I delete this one that was created by a VBScript file.

Thanks
avisitor's Avatar
Computer Specs
Senior Member with 571 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced to Einstein
12-Jul-2008, 09:41 PM #2
Did you try rmdir *.* in cmd. No guarantees that that won't do something totally unintended.

IGNORE THIS ADVICE!!! I misread the problem.

Last edited by avisitor : 12-Jul-2008 10:20 PM.
chuckeee's Avatar
Junior Member with 9 posts.
 
Join Date: May 2007
12-Jul-2008, 09:45 PM #3
I would be reluctant to try that because I have this problem on a work computer.
avisitor's Avatar
Computer Specs
Senior Member with 571 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced to Einstein
12-Jul-2008, 09:46 PM #4
Let me try it in a VM and we'll see what happens. However, I need a way to make a *.* directory.
chuckeee's Avatar
Junior Member with 9 posts.
 
Join Date: May 2007
12-Jul-2008, 09:54 PM #5
To create this folder, you can run the following code (just save it in a .vbs file).
Warning - do not run this unless you are prepared to have the same problem that I have right now.
Please change the "newFolderPath" variable to be wherever you want to create this "." folder.
--------------------

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

Dim newFolderPath
newFolderPath = "C:\."
objFSO.CreateFolder(newFolderPath)
avisitor's Avatar
Computer Specs
Senior Member with 571 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced to Einstein
12-Jul-2008, 10:02 PM #6
Whoops, didn't realize it was just . I thought it was called *.*. Hmm, . makes it even harder since that's the reference to current directory.
Broni's Avatar
Computer Specs
Senior Member with 975 posts.
 
Join Date: Dec 2007
Location: Daly City, CA
Experience: Advanced
12-Jul-2008, 10:10 PM #7
I'm trying to run your script on my VM XP installation, but I'm getting an error:

avisitor's Avatar
Computer Specs
Senior Member with 571 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced to Einstein
12-Jul-2008, 10:15 PM #8
Wait a minute: do you actually see the folder in Windows Explorer?

"." always means this directory in DOS. For example, if I'm in C:\Program Files\Mozilla Firefox and I execute ./Firefox.exe that's the same as executing Firefox.exe

I got an error upon running that script as well in Windows Server 2008 Standard:
__________________
Austin

Computers: Gateway CX2724 Tablet (XP Tablet/Ubuntu), HP ze5300 (Ubuntu),
Custom Killer Machine (XP/Vista/Ubuntu/Fedora, 8GB RAM, 2TB HD, Core 2 Quad)

Please refresh the page. I edit my posts often.
Broni's Avatar
Computer Specs
Senior Member with 975 posts.
 
Join Date: Dec 2007
Location: Daly City, CA
Experience: Advanced
12-Jul-2008, 10:15 PM #9
Something wrong with this line:
objFSO.CreateFolder(newFolderPath)
TerryNet's Avatar
Computer Specs
Distinguished Member with 17,604 posts.
 
Join Date: Mar 2005
Location: Ottawa, IL
Experience: Intermediate to Advanced
12-Jul-2008, 10:18 PM #10
If you do see it in Windows Explorer try to rename it.
avisitor's Avatar
Computer Specs
Senior Member with 571 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced to Einstein
12-Jul-2008, 10:21 PM #11
The folder "." exists in every directory and is a symlink/windows equivalent to that directory. As does the folder ".." which is a symlink to the directory above it.
chuckeee's Avatar
Junior Member with 9 posts.
 
Join Date: May 2007
12-Jul-2008, 10:21 PM #12
Avistor: yes I do see the folder in Windows Explorer. I can even enter the folder. When I look at the containing folder in the command window, I see TWO folders, both of which are called "." (a single dot)

Broni, try the following code. Make sure you already have a folder at C:\temp

Const workFolderBase = "C:\temp\"
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

Dim newFolderPath
newFolderPath = workFolderBase & ". "
objFSO.CreateFolder(newFolderPath)
chuckeee's Avatar
Junior Member with 9 posts.
 
Join Date: May 2007
12-Jul-2008, 10:23 PM #13
Terry - I cannot rename the folder either. When I try to do that it comes up with the same error message.
avisitor's Avatar
Computer Specs
Senior Member with 571 posts.
 
Join Date: Jul 2008
Location: Chicago, IL
Experience: Advanced to Einstein
12-Jul-2008, 10:24 PM #14
On running that, I got "Type mismatch: '[string "C:\Users\Administrat"]'"

EDIT: Ignore that. I had a * instead of a & on the 2nd to last line.

Now I get File Already Exists which is the same error as before.

OS is Windows Server 2008 Standard.
Broni's Avatar
Computer Specs
Senior Member with 975 posts.
 
Join Date: Dec 2007
Location: Daly City, CA
Experience: Advanced
12-Jul-2008, 10:24 PM #15
Same error.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 10:05 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.