我必须手动更改多个数据库数据分类列表中数千列的Sensitivity标签。我想使用发送键盘命令来模仿我必须手动执行的脚本的脚本来执行此操作。这可能与SSMS有关。
我已经从powershell和WshShell尝试过,但是它们都不能正确聚焦SSMS,甚至无法通过{tab}传递给SSMS。我也尝试过调用$ pid,但是没有运气。
@if (@CodeSection == @Batch) @then
@echo off
rem the script only works if the application in question is the active window. Set a timer to wait for it to load!
set SendKeys=CScript //nologo //E:JScript "%~F0"
timeout /t 5
rem use the tab key to move the cursor to the login and password inputs. Most htmls interact nicely with the tab key being pressed to access quick links.
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
%SendKeys% "{TAB}"
pause
goto :EOF
@end
// JScript section
var WshShell = WScript.CreateObject("WScript.Shell");
WshShell.SendKeys(WScript.Arguments(0));
我希望窗口显示标签跟踪器正在移动,就像我按下它一样。