示例#1
0
        private string Xcopy(bool pc)
        {
            string filePath;
            string text;
            string cmd;

            if (pc)
            {
                filePath = $@"\\192.168.9.179\data\{NewBaseTextBox.Text}.bat";
                text     = $@"XCOPY /Y /E /C /H /S /I F:\MYSQL40\data\{_oldBase}_bak F:\MYSQL40\data\{NewBaseTextBox.Text}";
                cmd      = $@"{AppDomain.CurrentDomain.SetupInformation.ApplicationBase}Tools\\PsExec.exe \\192.168.9.179 -u blacknull -p shangjia!@#123.idc1  -i  F:\MYSQL40\data\{NewBaseTextBox.Text}.bat";
            }
            else
            {
                filePath = $@"\\172.24.140.83\data\{NewBaseTextBox.Text}.bat";
                text     = $@"XCOPY /Y /E /C /H /S /I G:\mysql40\data\{_oldBase} G:\mysql40\data\{NewBaseTextBox.Text}";
                cmd      = $@"{AppDomain.CurrentDomain.SetupInformation.ApplicationBase}Tools\\PsExec.exe \\172.24.140.83 -u blacknull -p IDC2.passwd*()  -i G:\mysql40\data\{NewBaseTextBox.Text}.bat";
            }

            DirFile.CreateFile(filePath);
            DirFile.WriteText(filePath, text, Encoding.Default);

            var runCmd = new RunCmd();
            var result = runCmd.Exe(cmd);

            File.Delete(filePath);

            return(result);
        }
示例#2
0
        private string Wcopy()
        {
            var cmd = $@"wmic /node:'192.168.9.179' /password:'******' /user:'******' process call create 'XCOPY /Y /E /C /H /S /I F:\MYSQL40\data\{_oldBase}_bak F:\MYSQL40\data\{NewBaseTextBox.Text}'";

            var runCmd = new RunCmd();
            var result = runCmd.Exe(cmd);

            return(result);
        }