for ($i = 0; $i -lt 1000; $i++) {
(New-Object -ComObject "wscript.shell").SendKeys("^{ESC}")
# Optional: Add a small delay (e.g., 10 milliseconds) to prevent overwhelming the system
Start-Sleep -Milliseconds 10
}
for ($i = 0; $i -lt 1000; $i++) {
(New-Object -ComObject "wscript.shell").SendKeys("^{ESC}")
# Optional: Add a small delay (e.g., 10 milliseconds) to prevent overwhelming the system
Start-Sleep -Milliseconds 10
}
(New-Object -ComObject "wscript.shell").SendKeys("^{ESC}")
Start-Sleep -Seconds 3
[System.Windows.Forms.SendKeys]::SendWait("file explorere")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
function Send-MouseClick {
# Define the necessary Win32 API function for mouse events
$signature = @'
[DllImport("user32.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.StdCall)]
public static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint cButtons, uint dwExtraInfo);
'@
$mouseEvents = Add-Type -MemberDefinition $signature -Name "Win32MouseEvents" -Namespace "Windows" -PassThru
# Mouse event flags
$MOUSEEVENTF_LEFTDOWN = 0x0002
$MOUSEEVENTF_LEFTUP = 0x0004
# Get current cursor position
$cursorPos = [System.Windows.Forms.Cursor]::Position
$x = $cursorPos.X
$y = $cursorPos.Y
# Perform the left mouse button down and up events
$mouseEvents::mouse_event($MOUSEEVENTF_LEFTDOWN, $x, $y, 0, 0)
$mouseEvents::mouse_event($MOUSEEVENTF_LEFTUP, $x, $y, 0, 0)
}
# Loop 1000 times to perform 1000 clicks
for ($i = 0; $i -lt 1000; $i++) {
Send-MouseClick
# Optional: Add a small delay (e.g., 10 milliseconds) to prevent overwhelming the system
Start-Sleep -Milliseconds 10
}
Write-Host "1000 clicks performed."
Sub Macro2()
Shell "winword", vbNormalFocus
SendKeys "George W. Bush"
SendKeys "%{F4}", True
SendKeys "{ENTER}", True
'SendKeys "George W. Bush.txt", True' 'Comment'
'SendKeys "%S"' 'Comment'
End Sub
Type this below code in URL
file:///C:/
> Open developer tools in chrome
> Go to sources tab and select overrides tab
> Click on "select folder for overrides" and Select the folder where you want to change the overrides
> Right click on element of website and change color of background or style
> Click on sources tab and Page tab and save the css file in folder where you select the folder above.
If you want to delete, goto sources tab and goto overrides tab and delete overrides. And the website will be able to run as it was.
or you can use stylebot extension in chrome.
Sub CommandButton1_Click()
Shell "Notepad.exe", vbNormalFocus
Dim I As Integer
SendKeys "one"
SendKeys "{Enter}"
SendKeys "two"
End Sub
#Note This first line is mandatory
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
# Start WinWord (if not already running)
Start-Process -FilePath "winword.exe"
# Wait for WinWord to open and become active
Start-Sleep -Seconds 3
# Activate the WinWord window (adjust the title if necessary)
$wshell = New-Object -ComObject wscript.shell
#$wshell.AppActivate("Document1 - Word") # Or the actual document title
Start-Sleep -Seconds 1
# Send some text and an Enter key
[System.Windows.Forms.SendKeys]::SendWait("This is a test message.")
[System.Windows.Forms.SendKeys]::SendWait("{ENTER}")
[System.Windows.Forms.SendKeys]::SendWait("Another line of text.")
Application.Wait (Now + TimeValue("00:00:01"))
or
Application.Wait Now + TimeSerial(0, 0, 5)
Note: This is only work in Excel VBA, Not in Word VBA.
Selection.Copy
MsgBox "Copied ---- " & Selection
Note:- Copy Only a single cell , if more than one cell copied, it will give error
> With the help of Action Replay Extension in chrome
> Google chrome recorder can also be used for replay of steps.
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(100, 200)
$wshell = New-Object -ComObject wscript.shell
$wshell.AppActivate("Title of the application window") # Activate the target window
Start-Sleep -Seconds 5 # Give time for the window to activate
$wshell.SendKeys("Hello World{ENTER}")
After 5 seconds, it will paste in the window where cursor is clciked
> First Open chrome
> Click on 3 dots and click on cast, save and share
>Click on create shortcut and a shortcut will be created.