sirtombi
Goto Top

VNC Viewer per Batch starten und einloggen

Hallo,
ich würde gerne von einem Server aus, einen VNC Clienten auf einem Rechner im Netzwerk starten(jedes mal manuell, wenn benötigt, da die Rechner sehr schwach sind). Dies habe ich nun auch mithilfe folgender Batchzeile geschafft:

sc \\Rechnername start winvnc

Jetzt habe ich noch den VNC Viewer gestartet durch:

start vncviewer.exe

Nun würde ich gerne noch einbauen, dass die Batchdatei den VNC Viewer beim entsprechenden Rechner einloggt und das Passwort eingibt. Gibt es da eine Möglichkeit?
Vielen Dank schonmal für Eure Antworten
Lg
Tobias

Content-ID: 90425

Url: https://administrator.de/contentid/90425

Ausgedruckt am: 26.11.2024 um 18:11 Uhr

VB-NET
VB-NET 23.06.2008 um 14:36:49 Uhr
Goto Top
Das könnte dir weiterhelfen - VNC über Startparameter configurieren:

 
usage: vncviewer <options> <hostname>[:<display>]
Command-line options:
  -help                                - Provide usage information.
  -config <file>                       - Load connection settings from VNC Viewe
r 3.3 settings file
  -console                             - Run with a console window visible.
  <setting>=<value>                    - Set the named configuration parameter.
    (Parameter values specified on the command-line override those specified by
other configuration methods.)

Log names:
  SecurityWin32, CurrentUser, Service, CSecurityUserPasswd, SecurityRA2, Pointer
RateLimit, Pointer3Button, DynamicFn, TimerManager, Config, CircularBuffer, Down
loadManager, UploadManager, FileTransferExtension, RSA, CSecuritySSPI, Cursor, P
ixelBuffer, FullFramePb, UnicodeToKeysym, ManagedPb, CConnection, OverlappedInSt
ream, OleThread, PipeEndpoint, FileStream, DirEnumThread, DataObject, ClipboardH
elper, ClipboardFormats, ClipboardFiles, Threading, EventManager, DIBSectionBuff
er, WMShatter, SPointer, Clipboard, MsgWindow, ClipboardText, DeviceContext, Mon
itorInfo, LowLevelKeyEvents, EventSocketManager, CKeyboard, AboutDialog, RegConf
ig, Registry, PropSheet, Dialog, TcpFilter, TcpListenerManager, TcpSocket, main,
 Scaling, Options, Info, DesktopWindow, CConnManager, CConn

Log destinations:
  file
  stdout
  stderr

Parameters:
Global Parameters:
  Ticket     - Ticket to use to authenticate to server (default=)
  Log        - Specifies which log output should be directed to which target
               logger, and the level of output to log. Format is
               <log>:<target>:<level>[, ...]. (default=*:stderr:0)
  FileTransferLWM - Number of outstanding bytes before renewing a download, or
               -1 to disable renewal suppression. (default=-1)
  FileTransferBias - The approximate percentage of bandwidth to use for file
               transfers (0-95) (default=25)
  RSA_Private_Key_File - File from which to load the RSA private key
               (default=$HOME/.vnc/private.key)
  RSA_Private_Key - Private key to use for RSA encrypted key exchange
               (default=00000800eaddddd5e79b7d591c0e885e8a0ab9cdf9b93e7e65dddb6f
12f59129b86b06e79077a577ec99ebcac84ffb4b0d89527baaae6fede0c6ae0106fa901dfcb97510
b185a1cce7d805092fb1b308c6c6cde2cdd855d64d71ad34125cdec738c1df6c0abfb3748ee6b404
4bbd2f3598b097a72cb7a617b8e25dcc4b400df3b4c3959dd7508bdf8ad3ea0d4d104a50e25df0e2
b2c93fe07befacc65be4f247c5db43fe57a2099e6c38faffde4671305a556ea0aef27c79b685ec18
c1e6d27d3fc2af44e457b75b5950eede36c36a093fae407b79015d4579a1c567787299c0eefa9f4b
203c2782e0c07ace34c5817db07c984b3fc00a1ba177cb0c7986d36bdfa365830000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000010001dbb9b54fe8de0ee6ced8c9bba869606ad2b5fb41450bc9bea07e1cd06b37b5bd
edea0163b0764fa1e6c4ecd3ca562e5483d9addd5dec81dd7429f5aa184568bfb554cf8a635c3559
e2c4dc39d9bd23e08bb3589aa4d934b1027cdfee81aadedab533a32fe880ece917f265b83ea0f73f
ef15e0cd50aa76162a5042bd3cdfbd97a28aa8ace161a01c72586cebbd3f5bf01b453d759bf62066
37ba12ca4c2d42ce4695f83f14dc0ae7b736f8ebb7382fbad25ee334d062dcb926f5bb1a802d6a47
3f1a010be9cb388eaf5a4c44a6440e4f41bacdd69a81a3c3146284f92c3bfb507a8520d0f9f3dcfc
2d835e7df29a3f9180b50e1c9ed65e22447b76e199de2801f539198d5de8a2b4e3ada360e58b2326
99fb1681c1c5f6f8bffb3fa1c619078db331902813fb33e563f91f646b9c926c00065c0ba0da6afc
f1e5968e5a0ccba5c2b09c700dda0e61b7df4463497edd5032aae5227004627f1108106b08f4ed8b
7c0e4cf6144cfa823ccc67357408ad3c3153069278824d6b02a7e13b1575209bf5304062b38a00ce
7284757bd629d03573f914d0b9b68d558666727f1f538b05b6b9f73c91d92b4be7bc4890f13e9393
45876d4edf0eb91bcc11647bbe65471377d3bb1846d33158c9cf5269a01a530e14979b567176a56d
3f2cf81e1c505a0c1c127b97e9061c6bfdda96cd825d430f528a58b4cc050099d669a7838f201939
3c45a88e2282c75b068aeb1929d224f59beb2701058b8ec45d0b77fc5f204fc6f8403a5a5f6ee2b6
82f7fc4b4657d9754a1c460b65a1c9a21a227ffac50f580e89e7b6cba3dbf0a4fbf8986a7ee9fba3
7690a278f067637e2fc577a39733fc1ec8830b4f8075db2c9f9cedd1298fe8645f0b3516532053be
f58c25c3cbe659f99e981a5d7d925b592e3bbd9e5f75e6665ce09575395afa6a82a7cb91ac9aa647
08dd9b2d438dbc72b9af5124e7d6b9303e7e0dd74172cd8b4c6147a4bf0fd57ca33a823f7eb866a7
eec9ba9df5e0712e9f653d2619f84ba2b1858dec34164958a1e3d6abf91f69ccf483aa9dbda0439b
2aa1b02529fe66581b9775b22426f80954268a1a219bb1a4c62d65c225a64c0c7fe49464da980afc
8a9e6f16d0bf7b7c74ad34f875b2e4cd7b31ea3703bb94f35ea74e4cb90c7b3749abcfffd2caae28
d12bf2749579a69e8b3302c0d3328d1101632fcd12dbcdf6d65fcda69e259cdd24c8ee6120403552
7ba43a2564e5705f3294933eca77ff8720070476813c83a4)
  RSA_Public_Key - Public key to use for RSA encrypted key exchange (default=)
  RSA_Modulus_Bits - Total number of bits to use when generating public and
               private keys (default=2048)
  MaxOutBufferSize - The maximum number of bytes to buffer internally when
               writing to slowclients.  Larger values improve concurrency,
               smaller values reducememory usage.  Changes to this settings
               affect new connections only. (default=0)
  MaxCutText - Maximum length of incoming clipboard text (default=262144)
  FileTransferYieldThreshold - The percentage buffer space that must be used
               before explicitly yielding to the OLE thread. (default=85)
  FileTransferBufferSize - The size of the internal file transfer buffer
               (default=262144)
  DebugClipboardHelper - Provide a console and debug output for vncclipboard
               (default=0)
  MultiThreadedIStreams - Read from IStreams in a separate thread (recommended)
               (default=1)
  UseClipboardHelper - Support clipboard file transfer in a seperate process
               (0=no, 1=yes, -1=default) (default=-1)
  LazyFlushTimeout - Maximum number of seconds for which attempts should be
               made to flush data to an unresponsive client (maximum 49 days)
               (default=300)
  InTransports - List of address families on which to accept connections.
               Families are specified by number - see platform networking
               headers files for valid values. Special mnemonics IPv4 and IPv6
               are also supported. (default=IPv4)
  Listen     - Accept incoming connections from VNC servers. (default=0)
  IdHash     - Expected identity of the remote server, as a 64-bit hash.
               (default=)
  Identity   - Expected identity of the remote server, in full.  (default=)
  VerifyId   - When to warn regarding new or changed server identities.
               (2=always, 1=only if changed, 0=never) (default=2)
  SingleSignOn - Attempt to authenticate to servers using the current user
               credentials if the servers support it (default=1)
  AutoReconnect - Offer to reconnect to the remote server if the connectionis
               dropped because an error occurs. (default=1)
  MenuKey    - The key which brings up the popup menu (default=F8)
  Scaling    - Scale the desktop in the specified manner (None, Fit (fit
               window), AspectFit (fit window but maintain Aspect Ratio),
               <Width>x<Height>, <Percent>%,
               <Percent_Width>%x<Percent_Height>%, <Width>x, x<Height>)
               (default=None)
  Monitor    - The monitor to open the VNC Viewer window on, if available.
               (default=)
  UserName   - The user name for connecting to the server (default=)
  AcceptBell - Produce a system beep when requested to by the server.
               (default=1)
  Emulate3   - Emulate middle mouse button when left and right buttons are used
               simulatenously. (default=0)
  PointerEventInterval - The interval to delay between sending one pointer
               event and the next. (default=0)
  Protocol3.3 - Only use protocol version 3.3 (default=0)
  DisableWinKeys - Pass special Windows keys directly to the server.
               (default=1)
  ShareFiles - Enable file sharing with the server. (default=1)
  ServerCutText - Accept clipboard changes from the server. (default=1)
  ClientCutText - Send clipboard changes to the server. (default=1)
  SendKeyEvents - Send key presses (and releases) to the server. (default=1)
  SendPointerEvents - Send pointer (mouse) events to the server. (default=1)
  Shared     - Allow existing connections to the server to continue.(Default is
               to disconnect all other clients) (default=0)
  AutoSelect - Auto select pixel format and encoding (default=1)
  PreferredEncoding - Preferred graphical encoding to use - overridden by
               AutoSelect if set. (ZRLE, Hextile or Raw) (default=ZRLE)
  RelativePtr - Send relative pointer events (default=0)
  UseAllMonitors - Use all available monitors when entering full-screen mode
               (default=0)
  FullScreenChangeResolution - Adjust the display resolution to match that of
               theserver when in full-screen mode (default=0)
  FullScreen - Use the whole display to show the remote desktop.(Press F8 to
               access the viewer menu) (default=0)
  LowColourLevel - Colour level to use on slow connections. 0 = Very Low (8
               colours), 1 = Low (64 colours), 2 = Medium (256 colours)
               (default=1)
  FullColour - Use full colour (default is to use low colour unless auto select
               decides the link is fast enough). (default=0)
  UseDesktopResize - Support dynamic desktop resizing (default=1)
  UseLocalCursor - Render the mouse cursor locally (default=1)
  SelectDesktop - Name or number of desktop to select within a multi-desktop
               server (default=)
  Encryption - The encryption level to use when connecting to servers. Valid
               values are: Server, PreferOff, PreferOn, AlwaysOn.
               (default=Server)
  DstXor     - value to xor dest pixels for CopyRectDelay (default=65280)
  SrcXor     - value to xor source pixels for CopyRectDelay (default=255)
  CopyRectDelay - Milliseconds to display each copyrect - a debugging feature
               (default=0)
  DebugDelay - Milliseconds to display inverted pixel data - a debugging
               feature (default=0)


Die gewünschten Parameter kannst du in den Verknüpfungseigenschaften hinter den Zielpfad schreiben:
"C:\Programme\RealVNC\VNC4\vncviewer -blablabla" (Pfadangaben überprüfen)

Oder:
Eine Datei mit folgendem Inhalt (natürlich weiter anpassen):
[Connection]
Host=192.168.178.10:5900
[Options]
UseLocalCursor=1
UseDesktopResize=1
FullScreen=0
FullColour=1
LowColourLevel=1
PreferredEncoding=ZRLE
AutoSelect=1
Shared=0
SendPtrEvents=1
SendKeyEvents=1
SendCutText=1
AcceptCutText=1
DisableWinKeys=1
Emulate3=0
PointerEventInterval=0
Monitor=
MenuKey=F8
AutoReconnect=1
erstellen und als Dateiname.vnc speichern.

Hoffe ich konnte dir helfen.

Gruß

VB-NET
SirTombi
SirTombi 23.06.2008 um 15:31:12 Uhr
Goto Top
Dankesehr für die Antwort,
du hast mir damit sehr geholfen. Mit folgenden Zeilen funktioniert das ganz gut:

sc \\Rechnername start winvnc
pause
start vncviewer.exe rechnername

Er startet jetzt den Dienst auf dem Remote Pc und öffnet vncviewer auf dem Server mit dem richtigen Host. Leider habe ich es noch nicht geschafft eine Möglichkeit zu finden das Passwort gleich in die Batch mit einzubringen, sodass ich nurnoch die Batch starten muss.
Lg
Tobias
Midivirus
Midivirus 04.08.2009 um 23:26:05 Uhr
Goto Top
@echo off
"C:\Program Files\UltraVNC\vncviewer.exe" 192.0.2.50 /password VNCPC1

Quelle http://www.computing.net/answers/windows-2000/batchfile-for-vnc-connect ...