PDA

View Full Version : Batch Scripting (WXP-Pro)



ChromeX
05-01-2004, 04:56 PM
hello, what's wrong with this code:
rmdir /s /q C:\Docume~1\%USERNAME%\.limewire

dineshcooper
05-03-2004, 02:22 PM
Nothing

AmateurSysTech
05-04-2004, 04:08 PM
Windows doesn't like file/foldernames without any normal characters to the left of the period.

I am a Windows XP user that knows more about Windows PC's than many around me, and as so I am called upon to assist with their problems (for a small fee). and It never hurts to learn more tho'

msearly
05-05-2004, 10:39 AM
Try This
rmdir "/s /q C:\Docume~1\" & %USERNAME% & "\.limewire"

just put quotes to treat your expression like a string
Your %USERNAME% is an environment variable. If you put it in with the rest of your expression, VBS will treat it as a literal instead of a variable.

Or if you want get even more precise you could do this:

Dim net

Set net = CreateObject("WScript.Network")
rmdir "/s /q C:\Docume~1\" & net.UserName & "\.limewire"

Matt Early
Network Administrator
Prince Edward County Public Schools
Farmville, VA<P ID="edit"><FONT class="small">Edited by msearly on 05/05/04 09:42.</FONT></P>

ChromeX
05-12-2004, 11:44 AM
i've solved it some days ago, thank you all