首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >mstsc远程桌面问题

mstsc远程桌面问题
EN

Stack Overflow用户
提问于 2012-06-11 23:23:36
回答 1查看 1.2K关注 0票数 0

目前,为了改善日常处理过程中的一些低效,我正在尝试编写一个c# Winform应用程序,它将把用户输入与VBscripts相结合,从而加快以前所有用户输入的过程,即查看excel文件并将文件从VSS移动到特定服务器的特定文件夹。

我希望得到一些问题的答案,指出正确的方向:

使用命令行或其他解决方法,而不是手动

1)是否可以使用智能卡/pin登录到2003远程桌面?

2)是否可以通过您机器上的命令在远程桌面上运行文件/启动进程?

感谢您的帮助和时间

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-06-12 00:15:13

我只有第二个问题的经验。您可以使用远程脚本或诸如SysInternals PsExec http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx之类的实用程序来完成此操作。这里是一个vbscript,它可以远程启动ipconfig命令并将其重定向到文本文件。注意,您不能像这样启动交互进程,它们将启动但不会显示

代码语言:javascript
复制
Dim sComputer   'computer name
Dim sCmdLine    'command line of the process
Dim sCurDir   'working directory of the process
Dim oProcess    'object representing the Win32_Process class
Dim oMethod   'object representing the Create method
sComputer = "." 'this is the local computer, use a pcname or ip-adress to do it remote
sCmdLine = "cmd /c ipconfig.exe > c:\ipconfig.txt"
Set oProcess    = GetObject("winmgmts://" & sComputer & "/root/cimv2:Win32_Process")
Set oMethod     = oProcess.Methods_("Create")
Set oInPar    = oMethod.inParameters.SpawnInstance_()
oInPar.CommandLine  = sCmdLine
oInPar.CurrentDirectory = sCurDir
Set oOutPar     = oProcess.ExecMethod_("Create", oInPar)
If oOutPar.ReturnValue  = 0 Then
  WScript.Echo "Create process method completed successfully"
  WScript.Echo "New Process ID is " & oOutPar.ProcessId
Else
  WScript.Echo "Create process method failed"
End If
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/10983062

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档