ZenKensei Posted May 25, 2004 Share Posted May 25, 2004 Group, Was hoping to get a little help with a scripting question as part of an Active Directory Migration project I'm involved in at work. As part of the migration we're intent on using SMS to do as much of the work as possible and so now we're faced with cleaning up the PC's where SMS isn't quite working (yeah, I know, SMS is never REALLY working %100). Anyway, I've been working on a script to clean out the registry and delete the files and services that I know normally exist, but I also want to clean out the SMS user profile folders. The problem is that, on occasion, SMS runs rampant and creates multiple profiles on a PC (often with an extention of SMSCLiSvcAcct&.001, SMSCliSvcAcct&.002, etc). Is there a way to delete sub-folders similar to using a wildcard in DOS, i.e. DirRemove (C:\WinNT\Profiles\SMS*.*)? If not, how can I delete the directory without know the actual name or whether it really exist. It sounds simple, but I could not find anything in the doc's about using a wildcard for such a task. Thanks in advance, Z/K Link to comment Share on other sites More sharing options...
ZenKensei Posted May 25, 2004 Author Share Posted May 25, 2004 Larry, Just tested it, works like a champ! I can't thank you enough for your quick response. I guess I wasn't thinking that the FileFindFirstFile would work just as well on a Folder Ah, so much still to learn and yet so few brain cells left to store it in... DOH!!! Thanks again Z/K Link to comment Share on other sites More sharing options...
goodmanjl531 Posted January 22, 2014 Share Posted January 22, 2014 I just saw this and i was hoping to see what was your solution for this I need to delete folders and everything inside them that all have C:WindowsTempslu*.tmp any ideas? Thanks!! guinness 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 23, 2014 Moderators Share Posted January 23, 2014 goodmanjl531,Are you serious? The post above yours dates from nearly 10 years ago and the OP has not been online for 6 1/2 years! Please engage your brain before hitting the "Submit" button in future. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts