Sign in to follow this  
Followers 0
AntiVirusGuy

dirremove wildcards and network share Help

4 posts in this topic

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?

Share this post


Link to post
Share on other sites



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

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

this does not seem to work or do anything. Not really concerned about the atrib of the folder any ideas

Share this post


Link to post
Share on other sites

this does not seem to work or do anything. Not really concerned about the atrib of the folder any ideas

the 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.


1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0