AntiVirusGuy Posted December 8, 2005 Share Posted December 8, 2005 It looks like you can not use wild cards with dirremove and you can not access admin shares with dos del or rd. Anyone know how we can delete wildcarded prodiles off a network share? DirRemove("\\csctc1\C$\Documents and Settings\" & "$profile & ".*",1) we want to remove profiles like profile.1 profile.1.2 so on and so on and keep profile_second but the real issue is using wildcards over a net admin share. any ideas? Link to comment Share on other sites More sharing options...
seandisanti Posted December 8, 2005 Share Posted December 8, 2005 It looks like you can not use wild cards with dirremove and you can not access admin shares with dos del or rd. Anyone know how we can delete wildcarded prodiles off a network share? DirRemove("\\csctc1\C$\Documents and Settings\" & "$profile & ".*",1) we want to remove profiles like profile.1 profile.1.2 so on and so on and keep profile_second but the real issue is using wildcards over a net admin share. any ideas?maybe something like this? (untested) $search = FileFindFirstFile("\\csctc1\C$\Documents and Settings\*.*") While 1 if @error Then ExitLoop $file = FileFindNextFile($search) $ats = FileGetAttrib($file) if StringInStr($ats,"D") And StringInStr($file,".") Then DirRemove($file,1) EndIf WEnd Link to comment Share on other sites More sharing options...
AntiVirusGuy Posted December 8, 2005 Author Share Posted December 8, 2005 this does not seem to work or do anything. Not really concerned about the atrib of the folder any ideas Link to comment Share on other sites More sharing options...
seandisanti Posted December 8, 2005 Share Posted December 8, 2005 this does not seem to work or do anything. Not really concerned about the atrib of the folder any ideasthe attrib check is to make sure that the file being examined is a directory. the loop checks each file in the specified folder to make sure that if the file being examined is a directory, and has a decimal in the name, the directory should be removed. If nothing is happening when you run it, you may want to have the result of the DirRemove() assigned to to a variable... $blah = DirRemove($file,1) msgbox(0,"result",$blah) then you can tell if the directory was not removed. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now