Newsgroups: microsoft.public.scripting.vbscript
From: "PaulM" <N...@NONO.COM>
Date: Fri, 6 Nov 2009 16:08:28 -0500
Local: Fri, Nov 6 2009 9:08 pm
Subject: Re: Script
Thanks
"Richard Mueller [MVP]" <rlmueller-nos...@ameritech.nospam.net> wrote in > "PaulM" <N...@NONO.COM> wrote in message >> ' Description: Demonstration script that uses the FileSystemObject to >> Set WSHShell = WScript.CreateObject("WScript.Shell") >> objFSO.DeleteFile("F:\Users\TestUser\AppData\Local\test.vbs") >> And this script does not work: >> ' Description: Demonstration script that uses the FileSystemObject to >> Dim Windir >> Set WSHShell = WScript.CreateObject("WScript.Shell") >> objFSO.DeleteFile("%SystemRoot%\%Users%\%UserProfile%\%AppData%\%Local%\tes t.vbs") > Check out the LocalAppData environment variable. Also, once you retrieve > Set WshShell = CreateObject("Wscript.Shell") > LocalAppData = WshShell.ExpandEnvironmentStrings("%LocalAppData%") > objFSO.DeleteFile(LocalAppData & "\test.vbs") > Wscript.Echo LocalAppData & "\test.vbs" > -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||