Skip navigation

pullout.bat

@echo on & setLocal EnableDELAYedExpansion

@SET /a a = 1
for /r "C:\folder" %%f in (*.*) do (
  
  @move "%%f" "C:\destfolder"
)

run40Clients.bat

path=.
for /L %%x in (1,1,5) do start /b c:\putty.exe -load "_lab_1_"

pause

renamedirs.vbs

' shell script that renames dirs
  
Dim ofso
Set ofso = CreateObject( "Scripting.FileSystemObject" ) 

Dim re
Set re = new RegExp
're.Pattern = "\("
' the pattern looks for " M*(", basically for the "Mr. (" or "Mrs. (" or "Miss. ("
re.Pattern = "[\s][M][.\S]*[\s]\("

Dim folder
Set folder = ofso.GetFolder( "." )

' check EVERY subfolder
Dim osub
For Each osub In folder.SubFolders
  
  Dim name
  name = osub.Name
  
  Dim matches
  Set matches = re.Execute( osub.Name )
  
  Dim match
  For Each match In matches
    Dim ind
    ind = match.FirstIndex
    Dim str
    str = Left( name, ind )
    'WSH.Echo( str )
    
    osub.Name = str
    
    Next
  
  Next


WSH.Echo( "Done" )




' now let's try replace

re.Pattern = "r"
re.Global = True  ' GREEDY
Dim testStr
testStr = "herro there this is a string with r"
Dim result
result = re.Replace( testStr, "X" )

WSH.Echo( result ) 


'  
'Sub ShowTree( folder )
'  Dim osub
'  WSH.Echo folder.Path
'  For Each osub In folder.SubFolders
'    ShowTree osub
'  Next
'End Sub
'
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: