RDP Connect Script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
booga73
Posts: 108
Joined: 30 Nov 2011 16:16

RDP Connect Script

#1 Post by booga73 » 02 Dec 2013 13:30

Happy Holiday Season to All!

I've reposted my information, please read from my 2nd post which I resubmited my script for show'n tell and support.

I have the following script. the script is designed to RDP into a computer from a list of IP addresses in a text file. I have tried to the best of my intensions to document the script as needed for clarity. I'm using this script to follow up on a large laundry list of computers that need a manual check to verify if software is installed which will require me to connect RDP to each and literally visually inspect the software present if software is not or outdated then I need to fix the install or update as needed. Primarily, these stations that I am connecting to are largely laptop so it's a hit and miss that the server can't automatically verify if the software is present and/or working. So, I decided to write this script. And yes, with proper annotation, once it's working, I would like to add the person(s) name and mine to it so that person too gets commented into the script as who had work on it and made it successful. This project is a doozie and has alot of manual steps that I'm lazy about having to retype all over! And also, once the script is verified, free use of it to anybody for legitamate use too. (please excuse my spelling). Will post the script in it's entirety below. I would perfer to keep it simple and not too complex; this script took me the week of Thanksgiving to visualize, interpret and start drafting.

I'm trying to make my logic flow well so the script will work as intended.

For example the main area where I need help at is section D and G

In this section, D, t here is an errorlevel check present in the shutdown portion, I tried to script the idea if the shutdown instruction to the remote computer is errored then the errorlevel check sends message to a log file %UserName%_Trble_SHutdown-Session.txt

In this section, G, If I have a problem trying to connect with my RDP session, I want to record an error log for that too. log file name: %UserName%_Trble_RDP-Session.txt

thank you for your time and concerted effort, v/r Booga73

The script does the following:

1. Reads the IP address from IPList.txt and concatenates the 4 Octets together to read xxx.xxx.xxx.xxx.
2. After concantenate of the IP address script calls a subroutine. The subroutine then does a laundry list of statements.

Instructions that reside in the Subroutine:
A. identifies which computer via nslookup the sys admin is looking into support of.
B. calls for msg1.exe to be prepare to copy to remote computer (decided not to verify O/S version, trying to cut down time to run script and repair computers).

I'm not sure how to call in a batch file when the mappings are unknown the next available drive is available.

C. verify who is logged into the computer.
D. remote shutdown of computer

There is an errorlevel check present in the shutdown portion, I tried to script the idea if the shutdown instruction to the remote computer is errored then the errorlevel check sends message to a log file %UserName%_Trble_SHutdown-Session.txt

I'm thinking I should write: If not errorlevel 0 instead of If not errorlevel 1 or If errorlevel 1, I'm confused on the logic and the proper steps to record the error an the needed information to the log file.

E. code to ask if remote technician wants to complete a reverse of the remote shutdown, for conveyance of time to of running the script.
F. wait 5 Minutes before remote shutdown of computer. it would be neat to include a timer that would measure 5 minutes here, but i'm using my stop watch.
G. Starting Remote RDP to computer.
In this section, G, If I have a problem trying to connect with my RDP session, I want to record an error log for that too. log file name: %UserName%_Trble_RDP-Session.txt
I'm thinking I should write: If not errorlevel 0 instead of If not errorlevel 1 or If errorlevel 1, I'm confused on the logic and the proper steps to record the error an the needed information to the log file.

then shortly after subroutine ends the script returns back to the main batch program.
Last edited by booga73 on 12 Dec 2013 16:03, edited 1 time in total.

booga73
Posts: 108
Joined: 30 Nov 2011 16:16

Re: RDP Connect Script

#2 Post by booga73 » 02 Dec 2013 15:21

Perhaps I can add additional information, my text file, IPList.txt had IP addresses that appear as such .. .

xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx

When I run my script, the script does grab each IP token by token and pieces it back together; I wanted it this way thinking that the IP address would be read as a string versus an interger value.

But time to time, I get an IP address that gets stuck in the list that begins with a 172.xxx.xxx.xxx; that IP address I would like to completely ignore.

thank you, v/r Booga73

booga73
Posts: 108
Joined: 30 Nov 2011 16:16

Re: RDP Connect Script

#3 Post by booga73 » 12 Dec 2013 16:01

Hello,

I have have returned. This time, in good confidence. iPRDPv2, I have poured over my script again to verify consistency and that it works. Compared to the last posting, the last post was dreadful.

Wrote this tool for the intensions of helping fellow helpdesk / Sys Admins out there to help reduce his/her work load and work Efficiently. I'm sure this script could be expanded to do much more, but I value KISS, keep it simple and stupid; not too stupid though.

this script takes a list of computer names, complete an nslookup and for each assigned computer name, takes the address and outputs to a txt file so the main routine of my script calls a routine to RDP to each computer. I wrote this because on my network which I work on, I can't RDP via the computer name but only the IP Address and that I get a large list if computer names to boot too.

Also, I wanted to give a thank you :D :D :P :P to all the adv help I've had before here at this forum; I really appreciate the help and wanted to extend help out where I can to others. this is the best value which I can do.

I am running this script on a mixed mode network of XP and Win7; it appears to work.

I run the script, named: iPRDP.bat, from with in my folder, MyScripts, in this path:

C:\Users\%username%\Documents\MyScripts

3 other folders are present under MyScripts:

PSexecuLogs
tmp
tools

I place my needed tools in that folder.
I place 01msg.bat into the tools folder.
the 01msg.bat contains the following line:

Code: Select all


msg %userName% /TIME:180 Please Save Your Work. Sys Admin 1stName LstName (1stName.LstName@myDomain.com) will connect to your computer in less than 3 minutes. If any questions Please contact HelpDesk Staff at 123-456-7890.



Also, need to have PSexec.exe in the MyScripts folder too.


Now, I need help for the following chunks in the script:

Sections C, if there is a better way to find out who is currently logged into a computer.

SEction D, if there is any help to mask the input of the user name and password while end user is inputing his/her credentials.

Section E,

1. - if there's a better way to use Psexec to send a console message to who is currently logged into the remote machine.
2. - if the "errorlevel 1" arquement is enough to catch and put into a log file any error message from the shutdown command.

Section K,
1 - if the "errorlevel 1" arquement is enough to catch and put into a log file any error message from trying to RDP into a remote machine.


section C code:

Code: Select all

:: *********************************************************************************************************
:: Section C
:: this begins the process to verify who is logged in at remote computer

WMIC /NODE: %var1% COMPUTERSYSTEM GET USERNAME > C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt
more +1 C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt > C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt

del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt

cls

for /f "tokens=1,2 delims=\ " %%a in (C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt) do (
  If "%%a"=="" goto 01NoUser
  If not "%%a"=="" (
   set YUser1=%%b
   set YDOmain1=%%a
   goto 01YesUser
 )
)

:01YesUser
del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt
cls
goto NSL00KieUp

:01NoUser
del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt
cls
goto NSL00KieUp1

:NSL00KieUp
:: 1 beginning of identify to the current Sys Admin what computer he/she is connecting to.

echo ========================================
nslookup %var1%
ECho Initiating Ping Communication to %var1%.
echo Verifying if %var1% machine is still online.
echo.
Echo See Ping Windows for %var1%.
Echo.
echo Current User:   %YUser1%
echo Current Domain: %YDOmain1%
echo ========================================
Echo.
:: end of identify to the current Sys Admin what computer he/she is connecting to.
goto 01uNameApWrd

:NSL00KieUp1
:: 2 beginning of identify to the current Sys Admin what computer he/she is connecting to.
echo ========================================
nslookup %var1%
ECho Initiating Ping Communication to %var1%.
echo Verifying if %var1% machine is still online.
echo.
Echo See Ping Windows for %var1%.
Echo.
echo No User Currently on %var1%
echo ========================================
Echo.

:: end of identify to the current Sys Admin what computer he/she is connecting to.
:: this ends the process to verify who is logged in at remote computer
goto 01uNameApWrd
:: this ends the process to verify who is logged in at remote computer
:: *********************************************************************************************************



Section D

Code: Select all

:: *********************************************************************************************************
:: Section D
:: This begins the process to ask for credentials.
:: This section, for security, no solution found to mask real time input of SysAdmin's userName or password.

:01uNameApWrd
If "%pWrd%" == "" If "%uName%" == "" goto PwrdUsrNme01
If not "%pWrd%" == "" If not "%uName%" == "" goto 02PwrdUsrNme01

:PwrdUsrNme01
echo %UserName%, before you enter your password, make sure no-one is looking!
set /P uName=UserName:
set /P pWrd=Password:

:: This ends the process to ask for credentials.
:: *********************************************************************************************************



Section E

Code: Select all

.
.
C:\Users\%UserName%\Documents\MyScripts\psexec.exe \\%var1% -u "%YDOmain1%\%uName%" -p %pWrd% "c:\01SysAdmin\01MSG.bat" > C:\Users\%username%\Documents\MyScripts\PSExecuLogs\%var1%.txt
.
.


Section K

Code: Select all

.
.
If errorlevel 1 Echo %var1% having issues with RDP. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & nslookup %var1% >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & Echo ================================= >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt
.
.



very respectfully, Booga73


The entire code is the following:
----------------------------------------------------------------------------------------

Code: Select all


@ECHO OFF

:: *********************************************************************************************************
:: Section A
:: this begins the conversion of computer names and converts to IP address.
:: from hostname.txt to IPList.txt

If EXIST "C:\Users\%UserName%\Documents\MyScripts\IPList.txt" goto 01RDPStart
If NOT EXIST "C:\Users\%UserName%\Documents\MyScripts\IPList.txt" goto 02BuildIPList

:02BuildIPList
FOR /F %%i in (C:\Users\%UserName%\Documents\MyScripts\hostname.txt) do FOR /F "skip=4 delims=: tokens=2 usebackq" %%j in (`nslookup %%i`) do echo %%j >> C:\Users\%UserName%\Documents\MyScripts\IPList.txt
:: cls
:: this begins the conversion of computer names and converts to IP address.
:: *********************************************************************************************************
pause


:: *********************************************************************************************************
:: Section B
:: this begins the main body of the iPRDP routine to start the RDP process to remote computer.

:01RDPStart
for /f "tokens=1-4 delims=. " %%a in (C:\Users\%UserName%\Documents\MyScripts\IPList.txt) do (
set var1=%%a.%%b.%%c.%%d
echo Calling Client Station: %var1%
ping -n 1 %var1% | find "Reply from" & call :1iPRDP %1
)

cls
ECho THIS is the end of the list of IPs.
echo.
echo.
pause
exit /b

:: this ends the main body of the iPRDP routine to start the RDP process to remote computer.
:: *********************************************************************************************************


:: This Begins the MAIN 1iPRDP routine
:: *********************************************************************************************************

:1iPRDP %1

If Exist C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt
If Exist C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt

cls

:: *********************************************************************************************************
:: Section C
:: this begins the process to verify who is logged in at remote computer

WMIC /NODE: %var1% COMPUTERSYSTEM GET USERNAME > C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt
more +1 C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt > C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt

del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser1.txt

cls

for /f "tokens=1,2 delims=\ " %%a in (C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt) do (
  If "%%a"=="" goto 01NoUser
  If not "%%a"=="" (
   set YUser1=%%b
   set YDOmain1=%%a
   goto 01YesUser
 )
)

:01YesUser
del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt
cls
goto NSL00KieUp

:01NoUser
del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CrntUser2.txt
cls
goto NSL00KieUp1

:NSL00KieUp
:: 1 beginning of identify to the current Sys Admin what computer he/she is connecting to.

echo ========================================
nslookup %var1%
ECho Initiating Ping Communication to %var1%.
echo Verifying if %var1% machine is still online.
echo.
Echo See Ping Windows for %var1%.
Echo.
echo Current User:   %YUser1%
echo Current Domain: %YDOmain1%
echo ========================================
Echo.
:: end of identify to the current Sys Admin what computer he/she is connecting to.
goto 01uNameApWrd

:NSL00KieUp1
:: 2 beginning of identify to the current Sys Admin what computer he/she is connecting to.
echo ========================================
nslookup %var1%
ECho Initiating Ping Communication to %var1%.
echo Verifying if %var1% machine is still online.
echo.
Echo See Ping Windows for %var1%.
Echo.
echo No User Currently on %var1%
echo ========================================
Echo.

:: end of identify to the current Sys Admin what computer he/she is connecting to.
:: this ends the process to verify who is logged in at remote computer
goto 01uNameApWrd
:: this ends the process to verify who is logged in at remote computer
:: *********************************************************************************************************


:: *********************************************************************************************************
:: Section D
:: This begins the process to ask for credentials.
:: This section, for security, no solution found to mask real time input of SysAdmin's userName or password.

:01uNameApWrd
If "%pWrd%" == "" If "%uName%" == "" goto PwrdUsrNme01
If not "%pWrd%" == "" If not "%uName%" == "" goto 02PwrdUsrNme01

:PwrdUsrNme01
echo %UserName%, before you enter your password, make sure no-one is looking!
set /P uName=UserName:
set /P pWrd=Password:

:: This ends the process to ask for credentials.
:: *********************************************************************************************************




:: *****************************************************************************************************************************
:: Section E
:: Beginning of preparing remote computer, 1 if %var1% is online and 2 transfer needed tools to system.
:: I have a mix mode of computers on my network containing XP & Win7, so this is what I'm using to send message to my current logged in user.
:: msg.exe is native for Win7 but planning to use it for XP till XP is swapped out for a Win7 box.
:: the verifying of the network share 01SysAdmin and virtual z drive needs done to reset for rerun of batch file, next RDP session; just in case a batch file interuption occurs.

cls
:02PwrdUsrNme01
start ping -t %var1%

c:
cd\

If EXist "z:\01SysAdmin" rd /s /q "z:\01SysAdmin"

If EXist z: net use z: /delete /yes

IF NOT Exist z: goto CrtVirDir

:CrtVirDir
net use z: \\%var1%\c$

If NOT EXIST "z:\01SysAdmin" md z:\01SysAdmin\
echo.
copy /y C:\Users\%userName%\Documents\MyScripts\tools\*.* z:\01SysAdmin

:: Using psexec.exe to send messages to remote user's console.
:: 01msg.bat is initially located under tools folder and is copied to the remote machine so that a simply display of console message to current user who's logged in.
:: the 01msg.bat file is used to alert the current logged in user of the impending Sys Admin's intentions to RDP to end user's computer.
:: an example of what 01MSG.bat may contain
:: 01msg.bat --> msg %userName% /TIME:180 Please Save Your Work. Sys Admin 1stName LstName (1stName.LstName@myDomain.com) will connect to your computer in less than 3 minutes. If any questions Please contact HelpDesk Staff at 123-456-7890.

C:\Users\%UserName%\Documents\MyScripts\psexec.exe \\%var1% -u "%YDOmain1%\%uName%" -p %pWrd% "c:\01SysAdmin\01MSG.bat" > C:\Users\%username%\Documents\MyScripts\PSExecuLogs\%var1%.txt
ping -n 3 127.0.0.1 > nul 2>&1
:: pause
cls

echo ========================================
nslookup %var1%
ECho Initiating Ping Communication to %var1%.
echo.
Echo See Ping Windows for %var1%.
Echo.
echo Current User:   %YUser1%
echo Current Domain: %YDOmain1%
echo ========================================
Echo.
echo Reaching out to %var1% to verify if machine is online.
echo A successful reply back from %var1% in the Ping Window shows the online confirmation.
echo.
echo See %var1% Ping Window for activity confirmation.
echo.
Echo System Admin tools transfered to folder 01SysAdmin on %var1%.
echo.
echo Console message sent to %YDOmain1%\%YUser1% on %var1%.

:: Section E End of preparing remote computer, 1 if %var1% is online and 2 transfer needed tools to system.
:: *****************************************************************************************************************************


:: *****************************************************************************************************************************
:: Section F
:: Beginning permission of remote computer and shutdown / reboot.
:: these few commands initiates shutdown / reboot via the remote computer's security credentials.
:: reason why I chose to use the net use command then the shutdown cmd; during initial testing, I used to get an error code 5, but using net use sequence, the RDP session was more promptly authorized.

NET USE \\%var1%\IPC$ %pWrd% /USER:%uName%
shutdown /r /m \\%var1% /t 255 /f /c "^<Message here upto 199 characters including spaces, IE inform user SysAdmin is rebooting to RDP.^>"
If errorlevel 1 Echo System having issue with Remote Shutdown Command: %var1% >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_SHutdown-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_SHutdown-Session.txt & nslookup %var1% >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_SHutdown-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_SHutdown-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_SHutdown-Session.txt & Echo ================================= >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_SHutdown-Session.txt
NET USE \\%var1%\ipc$ /d
goto AskSA

:: End of permission of remote computer and shutdown / reboot.
:: *****************************************************************************************************************************




:: *****************************************************************************************************************************
:: Section G. this is beginning code to ask the remote technician if they want to change his/her mind about a remote computer shutdown.

:AskSA
echo.
echo Remote Shutdown Communication sent to %var1%.
echo.
echo Would you like to STOP the Remote System Shutdown for %var1% ?(Y/N)
set INPUT=
set /P INPUT=Type input: %=%
If "%INPUT%"=="y" goto 2Routine

goto 3Routine

:: this is the end code to ask the remote technician if they want to change his/her mind about a remote computer shutdown.
:: *****************************************************************************************************************************



:: *****************************************************************************************************************************
:: Section H
:: beginning section for status bar routine.
:: This is the piece of code where the status bar is initiated to provide Sys Admin a visual of a est. 4 minute waiting period till RDP to remote computer.

:3Routine
cls

setlocal enabledelayedexpansion
set "StatusBar= * * 4 * * * * * * * * * * * * 3 * * * * * * * * * * * * * * * 2 * * * * * * * * * * * * * * 1 * * * * * * connecting . . 0"
set /a count=0
:cycle
cls
set /A count+=1
SET "progressbar=!StatusBar:~0,%count%!"
set /a myCount=124-%count%

:: End of section for status bar routine.
:: *****************************************************************************************************************************


:: *****************************************************************************************************************************
:: Section I
:: Beginning section to initiate RDP session to remote computer.

echo ================================================================================
nslookup %var1%
ECho Initiating Ping Communication to %var1%.
echo.
echo Current User:   %YUser1%
echo Current Domain: %YDOmain1%
echo ================================================================================
Echo Remote Shutdown Command still in effect for %var1%
echo.
ECho If you don't wait 5 minutes you'll RDP to your computer to only be disconnected and %Var1% rebooted on you!
echo.
ECho To Abort Shutdown, @ CMD prompt type: shutdown /a /m \\%var1%
echo Next Instruction to follow in less then 4 minutes.
echo.

echo %mycount% %progressbar%
ping -n 3 127.0.0.1 > nul 2>&1
if %count% NEQ 124 goto :cycle

echo.
Echo %Var1% should be coming back online, examine Ping Window for %var1%.
echo.
echo ^< ^!^!^! Next Instruction ^!^!^! ---^> Hit any key to proceed with RDP to %var1%.^>
pause
echo.
echo ================================================================================
goto 01BeginRDPConnect

:: End section to initiate RDP session to remote computer.
:: *****************************************************************************************************************************


:: *****************************************************************************************************************************
:: Section J
:: this Begins set of instructions sends a remote shutdown of the remote computer.

:2Routine
shutdown /a /m \\%var1%
cls
echo ===============================================
nslookup %var1%
echo.
Echo See %var1% Ping Window for Online Connectivity.
Echo.
echo Current User:   %YUser1%
echo Current Domain: %YDOmain1%
Echo.
Echo Abort System Shutdown Command Sent to %var1%
Echo Continuing to RDP to %var1%.
echo.
ping -n 10 127.0.0.1 > nul
goto 01BeginRDPConnect

:: this Ends set of instructions sends a remote shutdown of the remote computer.
:: *****************************************************************************************************************************


:: *****************************************************************************************************************************
:: Section K
:: this section Begins defines the set of instructions to RDP to remote computer.

:01BeginRDPConnect
:: G Starting Remote RDP to computer.

Echo Preparing to connect %UserName% to RDP %var1%
echo.
Echo %Var1% coming back online.
Echo Look at Ping Window for %var1%.
echo ^< Hit any key to Start RDP to %var1% ^>
echo.
echo ===============================================
pause

cmdkey /generic:%var1% /user:%uName% /pass:%pWrd%
mstsc /v:%var1%
If errorlevel 1 Echo %var1% having issues with RDP. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & nslookup %var1% >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & Echo. >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt & Echo ================================= >> C:\Users\%UserName%\Documents\MyScripts\%UserName%_Trble_RDP-Session.txt

:: this section ends  the set of instructions to RDP to remote computer.
:: *****************************************************************************************************************************


:: *****************************************************************************************************************************
:: Section L
:: this begins the code to clear the uName and pWrd variable and mop up from the RDP session

cmdkey /delete:%uName%
cmdkey /delete:%pWrd%
If EXist "z:\01SysAdmin" rd /s /q "z:\01SysAdmin"
If EXist z: net use z: /delete /yes
taskkill /IM ping.exe /f

c:
cd\
cd C:\Users\%username%\Documents\MyScripts

:: this ends the code to clear the uName and pWrd variable and mop up from the RDP session
:: *****************************************************************************************************************************

:: *****************************************************************************************************************************
:: Section M
:: Beginning Create list of accomplished RDP computers
:: After each RDP session, CompIPList.txt log is created to later show / identify what progress was done for completing RDP / Software remediation on remote computer.

nslookup %var1% > C:\Users\%username%\Documents\MyScripts\tmp\CompCPU.txt
more +3 C:\Users\%username%\Documents\MyScripts\tmp\CompCPU.txt > C:\Users\%username%\Documents\MyScripts\tmp\CompCPU1.txt
del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CompCPU.txt
set /p CPUName=<C:\Users\%username%\Documents\MyScripts\tmp\CompCPU1.txt
Echo %CPUName% >> C:\Users\%UserName%\Documents\MyScripts\CompIPList.txt
del /f /q C:\Users\%username%\Documents\MyScripts\tmp\CompCPU1.txt

:: end of Create list of accomplished RDP computers
:: *****************************************************************************************************************************



cls
echo proceeding to next client station!!

exit /b
:: *********************************************************************************************************
:: This ends the MAIN 1iPRDP routine


Post Reply