Forum Discussion
ciscowaas
14 years agoOccasional Contributor
Here are the 2 scripts one with XP and other Win7
Test scenario:
Open a network share \\x.x.x.x\dir
copy a file and paste it in local disk C:\
Win XP:
function copy_file_to_local_from_server(p_str_src_path,p_str_dest_path,p_str_file_name)
{
var explorer;
var btnStart;
var sysListView32;
var comboBox;
var edit;
var wndCabinetWClass;
var folderView;
explorer = Aliases.explorer;
btnStart = explorer.wndShell_TrayWnd.btnStart;
btnStart.ClickButton();
sysListView32 = explorer.wndDV2ControlHost.DesktopSFTBarHost.SysListView32;
sysListView32.ClickItem("Run...", 0);
comboBox = explorer.dlgRun.ComboBox;
comboBox.SetText(p_str_src_path);
edit = comboBox.Edit;
edit.Keys("[Enter]");
wndCabinetWClass = explorer.wndCabinetWClass1;
folderView = wndCabinetWClass.SHELLDLL_DefView.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.FolderView;
folderView.ClickItemR(p_str_file_name, 0);
folderView.PopupMenu.Click("Copy");
wndCabinetWClass.Close();
btnStart.ClickButton();
sysListView32.ClickItem("Run...", 0);
comboBox.SetText(p_str_dest_path);
edit.Keys("[Enter]");
wndCabinetWClass = explorer.wndCabinetWClass;
folderView = wndCabinetWClass.SHELLDLL_DefView.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.FolderView;
folderView.ClickR(350, 300);
folderView.PopupMenu.Click("Paste");
wndCabinetWClass.Close();
}
// in the above code, we replaced the real file names/ip values with variables, didn't change any thing else in the code
Win7:
function Test1()
{
var explorer;
var wndStart;
var directUIHWND;
var wndtesting;
var directUIHWND2;
explorer = Aliases.explorer;
wndStart = explorer.wndStart;
wndStart.ClickButton();
directUIHWND = explorer.wndDV2ControlHost.DesktopOpenBoxHost.SearchBox.SearchEditBoxWrapperClass.DirectUIHWND;
directUIHWND.Click(44, 8);
directUIHWND.Keys("\\\\2.75.253.4\\testing[Enter]");
wndtesting = explorer.wndCabinetWClass1;
directUIHWND2 = wndtesting.testing.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND2 = wndtesting.ats_cifs_exploratory.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND2.ClickR(63, 81);
directUIHWND2.PopupMenu.Click("Copy");
wndStart.ClickButton();
directUIHWND.Click(68, 14);
directUIHWND.Keys("C:\\[Enter]");
directUIHWND = wndtesting.ShellTabWindowClass.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND.ClickR(142, 28);
directUIHWND.PopupMenu.Click("Paste");
explorer.dlgCopyFile.DirectUIHWND.Click(154, 129);
wndtesting.Close();
wndtesting.Close();
}
Test scenario:
Open a network share \\x.x.x.x\dir
copy a file and paste it in local disk C:\
Win XP:
function copy_file_to_local_from_server(p_str_src_path,p_str_dest_path,p_str_file_name)
{
var explorer;
var btnStart;
var sysListView32;
var comboBox;
var edit;
var wndCabinetWClass;
var folderView;
explorer = Aliases.explorer;
btnStart = explorer.wndShell_TrayWnd.btnStart;
btnStart.ClickButton();
sysListView32 = explorer.wndDV2ControlHost.DesktopSFTBarHost.SysListView32;
sysListView32.ClickItem("Run...", 0);
comboBox = explorer.dlgRun.ComboBox;
comboBox.SetText(p_str_src_path);
edit = comboBox.Edit;
edit.Keys("[Enter]");
wndCabinetWClass = explorer.wndCabinetWClass1;
folderView = wndCabinetWClass.SHELLDLL_DefView.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.FolderView;
folderView.ClickItemR(p_str_file_name, 0);
folderView.PopupMenu.Click("Copy");
wndCabinetWClass.Close();
btnStart.ClickButton();
sysListView32.ClickItem("Run...", 0);
comboBox.SetText(p_str_dest_path);
edit.Keys("[Enter]");
wndCabinetWClass = explorer.wndCabinetWClass;
folderView = wndCabinetWClass.SHELLDLL_DefView.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.FolderView;
folderView.ClickR(350, 300);
folderView.PopupMenu.Click("Paste");
wndCabinetWClass.Close();
}
// in the above code, we replaced the real file names/ip values with variables, didn't change any thing else in the code
Win7:
function Test1()
{
var explorer;
var wndStart;
var directUIHWND;
var wndtesting;
var directUIHWND2;
explorer = Aliases.explorer;
wndStart = explorer.wndStart;
wndStart.ClickButton();
directUIHWND = explorer.wndDV2ControlHost.DesktopOpenBoxHost.SearchBox.SearchEditBoxWrapperClass.DirectUIHWND;
directUIHWND.Click(44, 8);
directUIHWND.Keys("\\\\2.75.253.4\\testing[Enter]");
wndtesting = explorer.wndCabinetWClass1;
directUIHWND2 = wndtesting.testing.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND2 = wndtesting.ats_cifs_exploratory.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND2.ClickR(63, 81);
directUIHWND2.PopupMenu.Click("Copy");
wndStart.ClickButton();
directUIHWND.Click(68, 14);
directUIHWND.Keys("C:\\[Enter]");
directUIHWND = wndtesting.ShellTabWindowClass.DUIViewWndClassName.DirectUIHWND.CtrlNotifySink.ShellView.DirectUIHWND;
directUIHWND.ClickR(142, 28);
directUIHWND.PopupMenu.Click("Paste");
explorer.dlgCopyFile.DirectUIHWND.Click(154, 129);
wndtesting.Close();
wndtesting.Close();
}
Related Content
- 15 years ago
- 15 years ago
Recent Discussions
- 42 minutes ago
- 15 hours ago
- 7 days ago
- 10 days ago