Scripting
http://www.microsoft.com/technet/desktopdeployment/depprocess/osddlex_6.mspx
DOS Links:http://home.att.net/~gobruen/progs/dos_batch/dos_batch.html
http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html
http://goforit.unk.edu/msdos/msdos19.htm
http://www.aumha.org/a/batches.php
http://www.scriptinganswers.com/archive/articles/Copyfolderwithsubfolderstoremoteworkstations.htm
http://www.computerhope.com/batch.htm#windows
http://www.csidata.com/custserv/onlinehelp/VBSdocs/vbs270.htm
4 Comments:
- http://www.winguides.com/scripting/reference.php?id=109
- http://www.johnrostron.co.uk/bill/troubleshooting/programming/windows_scripting.htm
http://steve-parker.org/code/sh/idx.shtml
http://nwn.bioware.com/builders/sctutorial.html
- IMP IMP: http://www.injunea.demon.co.uk/pages/page203.htm
- IMP: http://www.cyberciti.biz/nixcraft/linux/docs/uniqlinuxfeatures/lsst/
Sub WriteFile(sFilePathAndName,sFileContents)
Const ForWriting =2
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
Set oFSFile = oFS.OpenTextFile(sFilePathAndName,ForWriting,True)
oFSFile.Write(sFileContents)
oFSFile.Close
Set oFSFile = Nothing
Set oFS = Nothing
End Sub
Function ReadFile(sFilePathAndName)
dim sFileContents
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If oFS.FileExists(sFilePathAndName) = True Then
Set oTextStream = oFS.OpenTextFile(sFilePathAndName,1)
sFileContents = oTextStream.ReadAll
oTextStream.Close
Set oTextStream = nothing
End if
Set oFS = nothing
ReadFile = sFileContents
End Function
Sub ReadFileLineByLine(sFilePathAndName)
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8
Const TristateUseDefault = -2
Const TristateTrue = -1
Const TristateFalse = 0
Dim oFS
Dim oFile
Dim oStream
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = oFS.GetFile(sFilePathAndName)
Set oStream = oFile.OpenAsTextStream(ForReading, TristateUseDefault)
Do While Not oStream.AtEndOfStream
sRecord=oStream.ReadLine
Response.Write sRecord
Loop
oStream.Close
End Sub
Sub RemoveFolder(sPath,fRemoveSelf)
Dim oFS
Dim oFSFolder
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If oFS.FolderExists(sPath) <> True Then
Set oFS = Nothing
Exit Sub
End If
Set oFSFolder = oFS.GetFolder(sPath)
RemoveSubFolders oFSFolder
If fRemoveSelf = True Then
If oFS.FolderExists(sPath) = True Then
oFSFolder.Delete True
Else
Set oFSFolder = Nothing
Set oFS = Nothing
Exit Sub
End If
End If
Set oFSFolder = Nothing
Set oFS = Nothing
End Sub
Sub RemoveSubFolders(oFSFolder)
Dim oFSFile
Dim oFSSubFolder
For Each oFSFile In oFSFolder.Files
oFSFile.Delete True
Next
For Each oFSSubFolder In oFSFolder.SubFolders
RemoveSubFolders oFSSubFolder
oFSSubFolder.Delete True
Next
Set oFSFile = Nothing
End Sub
Sub RemoveFile(sFilePathAndName)
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
If oFS.FileExists(sFilePathAndName) = True Then
oFS.DeleteFile sFilePathAndName, True
end if
Set oFS = Nothing
End Sub
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/32a1c6c4-255b-4281-8bd8-213096ea1fe0.asp
Post a Comment
<< Home