Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Perform remote intallation via script

$
0
0

Hi,

My aim is to push script (.bat file along with the installer or any other task that would run on any client within my network)

I have two batch file named remoteload.bat and remoteload2_kb.bat, localinst folder with working.bat

this two script will run after running command (remoteload test.txt 8:20 localinst) via command prompt with admin privileged

-it would run remoteload.bat to client indicated in test.txt at 8:20am in c:\localinst

My problem is I'm getting this error.
Warning: Due to security enhancements, this task will run at the time
expected but maybe not interactively.
Use schtasks.exe utility if interactive task is required ('schtasks /?'
for details).

How would I add to scheduled task?

CODE:
@echo off
set rmtload=%1
rem %1 is agent machine to change and %2 is time in 24 hr terms to run the install
rem %2 is load time

@echo off
ping %1 -n 1 >pingtst.txt
qgrep -y -z reply pingtst.txt >nul
if %errorlevel%==0 goto machon
goto noton

:machon
@echo Loading on %1

md \\%1\c$\localinst>nul
copy localinst\*.* /y \\%1\c$\localinst>nul
if not %errorlevel%==0 goto failcopy
set rmtload=%rmtload%, files copied

rem load time
at \\%1 %2 /interactive  c:\localinst\working.bat
set rmtload=%rmtload%, schedule set
goto end

:failcopy
set rmtload=%rmtload%, failed copy
goto end

:failsched
set rmtload=%rmtload%, failed schedule
goto end

:noton
set rmtload=%rmtload%, Not On ***
goto end

:end
@echo %rmtload% >> %result%



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>