Jump to content

Recommended Posts

Posted (edited)

I beleive I found the problem with not being able to use the original scriopt.

My original had been altered, my error.

It now works flawlessly... except

still cannot delete files in (userprofilename)\local settings\Temp

I think we have gotten into a lot of details that may not be solving the problem.

I have script written for deleting all files in:

(Windir)\Temp

(Windir)\Prefetch

I justy want to add deleteing of all files in (userprofilename)\local settings\Temp

when the directory name of (userprofilename) is not known in advance.

So basically I believe I just need the correct syntax and equation for: "$path = "

example

"$path = @WindowsDir & '\Prefetch'" finds "%Prefetch%" perfectly.

I want $path to find (userprofilename)\local settings\Temp

I do thank all who have been trying to assist me with this.

Edited by keypuncher
  • Replies 42
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted

Got it. it works

$path = @UserProfileDir & '\Local Settings\Temp'

very simple

I may still need variables if the rest of the path to this "Temp"after UserProfileDir is not the same as "Local Settings" but that should not be too challenging.

Why I could not get it working before, I don't know.

Either I was too buried in it to see it clearly or it was a case of proofreading my own work so much that I kept being blind to the same mistakes.

Reworte it almost exactly as it was before and now it worked. as I have time I may go back and try to see where I goofed. For now I'm a bit happier.

Thanks again to all who offered assistance

Posted

Got it. it works

$path = @UserProfileDir & '\Local Settings\Temp'

very simple

I may still need variables if the rest of the path to this "Temp"after UserProfileDir is not the same as "Local Settings" but that should not be too challenging.

Why I could not get it working before, I don't know.

If permanent changes are made to the users %TEMP% & %TMP% environmental variables within the registry then your code will fail. The correct answer was given in the 1st reply of this thread.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...