« VBScript » : différence entre les versions

De UnixWiki
Aller à la navigation Aller à la recherche
(Page créée avec « Print text wscript.echo("text") Write in a text file Set objFSO=CreateObject("Scripting.FileSystemObject") outFile="C:\Users\User\Desktop\Results.txt" Set obj... »)
 
Aucun résumé des modifications
 
(5 versions intermédiaires par le même utilisateur non affichées)
Ligne 1 : Ligne 1 :
Print text
Print text
wscript.echo("text")
Wscript.echo("text")


Write in a text file
Write in a text file
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set objFSO=CreateObject("Scripting.FileSystemObject")
outFile="C:\Users\User\Desktop\Results.txt"
outFile=CreateObject("WScript.Shell").SpecialFolders("Desktop") + "\stage1.txt"
Set objFile = objFSO.CreateTextFile(outFile,True)
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.WriteLine variable
objFile.WriteLine variable

Append in a text file
Set objFSO=CreateObject("Scripting.FileSystemObject")
outFile=CreateObject("WScript.Shell").SpecialFolders("Desktop") + "\stage2.txt"
Set objFile = objFSO.OpenTextFile(outFile, 8, True)
objFile.WriteLine variable

If you can't see all the variable value with the watch point, you can open immediate window View--> Intermediate Window or CTRL-G and type
<code>
debug.print VARIABLE_NAME
</code>

Copy variable into the clipboard
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Visible = False
objIE.Navigate("about:blank")
objIE.document.parentwindow.clipboardData.SetData "text", host
objIE.Quit

Dernière version du 15 février 2019 à 11:10

Print text

  Wscript.echo("text")

Write in a text file

  Set objFSO=CreateObject("Scripting.FileSystemObject")
  outFile=CreateObject("WScript.Shell").SpecialFolders("Desktop") + "\stage1.txt"
  Set objFile = objFSO.CreateTextFile(outFile,True)
  objFile.WriteLine variable

Append in a text file

  Set objFSO=CreateObject("Scripting.FileSystemObject")
  outFile=CreateObject("WScript.Shell").SpecialFolders("Desktop") + "\stage2.txt"
  Set objFile = objFSO.OpenTextFile(outFile, 8, True)
  objFile.WriteLine variable

If you can't see all the variable value with the watch point, you can open immediate window View--> Intermediate Window or CTRL-G and type debug.print VARIABLE_NAME

Copy variable into the clipboard

  Set objIE = CreateObject("InternetExplorer.Application")
  objIE.Visible = False
  objIE.Navigate("about:blank")
  objIE.document.parentwindow.clipboardData.SetData "text", host
  objIE.Quit