Uploaded Test files

This commit is contained in:
Batuhan Berk Başoğlu 2020-11-12 11:05:57 -05:00
parent f584ad9d97
commit 2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions

View file

@ -0,0 +1,34 @@
#app=WScript.Application
#app._print_details_() # Use this to see what Python knows about a COM object.
g_index = 1
# A procedure, using a global.
def Show(desc, value = None):
global g_index # Need global for g_index, as I locally assign.
# No global needed to "xl" object, as only referenced.
# Also note "xl" is assigned later in the script - ie, Python is very late bound.
xl.Cells(g_index, 1).Value = desc
if value: xl.Cells(g_index, 2).Value = value
g_index = g_index + 1
xl = WScript.CreateObject("Excel.Application")
import sys
xl.Visible = 1
#xl.Workbooks().Add() # Excel versions before 98
xl.Workbooks.Add()
# Show the WScript properties.
Show("Application Friendly Name", WScript.Name)
Show("Application Version", WScript.Version)
Show("Application Context: Fully Qualified Name", WScript.FullName)
Show("Application Context: Path Only", WScript.Path)
Show("State of Interactive Mode", WScript.Interactive)
Show("All script arguments:")
args = WScript.Arguments
for i in range(0,args.Count()):
Show("Arg %d" % i, args(i))

View file

@ -0,0 +1,45 @@
""" Windows Script Host Sample Script
' Ported to Python
'
' ------------------------------------------------------------------------
' Copyright (C) 1996 Microsoft Corporation
'
' You have a royalty-free right to use, modify, reproduce and distribute
' the Sample Application Files (and/or any modified version) in any way
' you find useful, provided that you agree that Microsoft has no warranty,
' obligations or liability for any Sample Application Files.
' ------------------------------------------------------------------------
'
' This sample demonstrates how to write/delete from the registry.
"""
WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Popup("This script shows how to use registry related methods.", 2)
WshShell.Popup("Create key HKCU\\Foo with value 'Top level key'")
WshShell.RegWrite("HKCU\\Foo\\", "Top level key")
WshShell.Popup("Create key HKCU\\Foo\\Bar with value 'Second level key'")
WshShell.RegWrite( "HKCU\\Foo\\Bar\\", "Second level key")
WshShell.Popup ("Set value HKCU\\Foo\\Value to REG_SZ 1")
WshShell.RegWrite( "HKCU\\Foo\\Value", 1)
WshShell.Popup ("Set value HKCU\\Foo\\Bar to REG_DWORD 2")
WshShell.RegWrite ("HKCU\\Foo\\Bar", 2, "REG_DWORD")
WshShell.Popup ("Set value HKCU\\Foo\\Bar to REG_EXPAND_SZ '3'")
WshShell.RegWrite ("HKCU\\Foo\\Bar\\Baz", "%SystemRoot%\\Foo")
WshShell.Popup ("Delete value HKCU\\Foo\\Bar\\Baz")
WshShell.RegDelete ("HKCU\\Foo\\Bar\\Baz")
WshShell.Popup ("Delete key HKCU\\Foo\\Bar")
WshShell.RegDelete ("HKCU\\Foo\\Bar\\")
WshShell.Popup ("Delete key HKCU\\Foo")
WshShell.RegDelete ("HKCU\\Foo\\")
WScript.Echo ("Done")

View file

@ -0,0 +1,15 @@
# Testall - test core AX support.
# Test "Restricted Execution" (ie, IObjectSafety).
# This will fail if in a "restricted execution" environment, but
# will silenty do nothing of not restricted. This same line in an MSIE
# script would cause an exception.
print("Importing win32api...")
import win32api
if 1==1:
print("Hi")
WScript.Echo("Hello from WScript")
#fail