Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to update rdp wrap remotely via script #347

Closed
gw1966 opened this issue Nov 10, 2017 · 10 comments
Closed

Option to update rdp wrap remotely via script #347

gw1966 opened this issue Nov 10, 2017 · 10 comments

Comments

@gw1966
Copy link

gw1966 commented Nov 10, 2017

Hi.

I was wondering if there was a way/script to update rdpwrap to machines that have been updated from W7 to W10 or a newer version of W10.

Something like what files/registry changes? need to be changed or files updated and what url can I get them from the internet?
After I know what files I just need to know the services to stop to update these files and then start again?

Not urgent, but saves me going onto each machine and running update.bat manually.
Maybe this info is already written somewhere and you can just point me to it?

Grant.

@binarymaster
Copy link
Member

You can run the installer and/or batch files from the system scheduler.

@okibcn
Copy link

okibcn commented Nov 12, 2017

I did something similar for new installations so I could update remotely any new computer in the domain. You will need psexec.exe in the same directory. It is part of the PSTools.zip available here https://docs.microsoft.com/en-us/sysinternals/downloads/pstools. You'll need to have admin access to the remote computers. Then create a text file called RemoteInstall.cmd with the following content and place it in the same RDPWrap folder in your local computer:

@echo off
IF /I "%1"=="" GOTO BLANK
IF "%1"=="-h" GOTO BLANK
IF "%1"=="/?" GOTO BLANK

robocopy %~dp0 %1\c$\kk /MIR
psexec %1 cmd /c c:\kk\RDPWInst -i -o
del %1\c$\kk /q /s
rd %1\c$\kk

ECHO Done!
GOTO DONE

:BLANK

ECHO.
ECHO Enables multiple sessions in a remote machine.
ECHO.
ECHO Usage:
ECHO REMOTEINSTALL \\machine_name
ECHO.
ECHO machine_name - is the SMB name of the remote computer
ECHO.
ECHO Example: REMOTEINSTALL \\remotepc
ECHO.
ECHO Note: Ensure you have write access to the admin share \\machine_name\c$ in the remote machine.

:DONE

You can also do a remote using this code in a file called RemoteUpdate.cmd placed in your local RDPWrap folder:

@echo off
IF /I "%1"=="" GOTO BLANK
IF "%1"=="-h" GOTO BLANK
IF "%1"=="/?" GOTO BLANK

robocopy %~dp0 %1\c$\kk /MIR
psexec %1 cmd /c c:\kk\RDPWInst -w
del %1\c$\kk /q /s
rd %1\c$\kk

ECHO Done!
GOTO DONE

:BLANK

ECHO.
ECHO Updates multiple sessions in a remote machine.
ECHO.
ECHO Usage:
ECHO REMOTEUPDATE \\machine_name
ECHO.
ECHO machine_name - is the SMB name of the remote computer
ECHO.
ECHO Example: REMOTEUPDATE \\remotepc
ECHO.
ECHO Note: Ensure you have write access to the admin share \\machine_name\c$ in the remote machine.

:DONE

@gw1966
Copy link
Author

gw1966 commented Nov 14, 2017

Thanks all. I will give it a go in the next week :)

@gw1966
Copy link
Author

gw1966 commented Nov 21, 2017

Hi Guys, most of the time this seems to work ok, every now and then, the endpoint fails to download. See below.

[*] Downloading latest INI file...
[-] Failed to get online INI file, using built-in.
[+] Extracted config -> C:\Program Files\RDP Wrapper\rdpwrap.ini
[+] Extracted rdpw64 -> C:\Program Files\RDP Wrapper\rdpwrap.dll

Is there any option in the RDPWInst.exe that will allow me to use a locally located INI file that I can download from the website to install with that version?
https://github.com/stascorp/rdpwrap/blob/master/res/rdpwrap.ini

Is there a readme file for RDPWInst for different options as I can see a few different options in some of the forums? -w -o

If I try to override the ini file it states its in use by another process? What is the switch to stop the rdpwrap, then I could probably override file and then the command to restart rdpwrap?

Grant

@binarymaster
Copy link
Member

Is there any option in the RDPWInst.exe that will allow me to use a locally located INI file

Currently no, see #300.

Is there a readme file for RDPWInst for different options as I can see a few different options in some of the forums? -w -o

Everything you need is in source code.

@gw1966
Copy link
Author

gw1966 commented Nov 29, 2017

Hi.

Sorry, I have one more question, which services do I need to stop to update the rdpwrap.ini file, when I tried to replace it on a machine, I got the message "it's in use" by a process.

Grant

@gw1966
Copy link
Author

gw1966 commented Jan 31, 2018

Hi, Just double checking, I can see you have added an option to use a local ini file. Is there a command switch to use the local ini file or will it just take it from the local install folder if it exists? I tried to look in help guides but cant find info :)

Grant

@tvcat
Copy link

tvcat commented Apr 19, 2018

@gw1966
If it is installed then you need to uninstall first.

Save your edited ini file to the installer folder (rdpwrap.ini)

By default when you run the install.bat it will use this parameter "-i -o" which mean the installer will download the latest ini file.

So you have to run "RDPWInst -i" then the installer will use the ini file in the installer folder.

@Hopfengetraenk
Copy link

Hopfengetraenk commented Feb 17, 2019

I just worked a little on the script:

@prompt -$

	@IF /I "%1"==""   GOTO Show_Help
	@IF    "%1"=="-h" GOTO Show_Help
	@IF    "%1"=="/?" GOTO Show_Help

	@set rdpWrapTempDir=\rdpWrapTemp
	robocopy 	%~dp0 	%1\c$%rdpWrapTempDir% /MIR

	::http://docs.microsoft.com/sysinternals/downloads/pstools
	psexec %1 cmd /c c:%rdpWrapTempDir%\RDPWInst -i -o

	@del %1\c$%rdpWrapTempDir% /q /s /f
	@rd  %1\c$%rdpWrapTempDir%
        @pause >nul
	@ECHO Done!
	
@GOTO :EOF

:Show_Help
	@ECHO.
	@ECHO === RDPWrap RemoteInstall v1.0 (17.02.2019) ===
	@ECHO.
	@ECHO Enables multiple sessions in a remote machine.
	@ECHO.
	@ECHO Usage:
	@ECHO      REMOTEINSTALL \\machine_name
	@ECHO                     machine_name - is the SMB name of the remote computer
	@ECHO.
	@ECHO Example: 
	@ECHO      REMOTEINSTALL \\remotepc
	@ECHO.
	@ECHO Notes: Ensure you have write access to the admin share \\machine_name\c$ in the remote machine.
	@ECHO.
	@ECHO        For some stupid reason Windows only access to 'that administative share' for 
	@ECHO        the build-in 'Administrator' Account/user (SID: S-1-5-21-500)
	@ECHO        Users with just administrative rights(by being member of the Administrators Group) will fail to access c$.
	@ECHO.
	@ECHO        Run cmd.exe(run as admin) and there run "net user Administrator  /active:yes" or 
	@ECHO        use (Super+R)Execute: netplwiz, lusrmgr to enable and set some password for Administrator
	@pause >nul
@GOTO :EOF

@sebaxakerhtc
Copy link

Closed as solved. If not - reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants