New
#1
creating a batch script to create a scedualed task on multiple pc's
so im an IT specialist at a big car dealer ship im not that good with scripting but what i want to do is when i go around to a computer i want to be able to put a flash drive in run a batch script that creates a folder on the C drive transfers a few files (xml and .bat ) to that folder then from that folder i want to run the batch script that will create a scheduled task to run ccleaner when the pc is in idle for 10 min
we have 600+ pc's some are on the domain some are off the domain with various user names/passwords and pc names also different os's (xp win 7 and some vista) some are 32 bit but most are 64 bit
ok so i made a scheduled task on my pc then exported the XML i put the files on a flash drive then i made a batch to copy the other batch scripts/xml's to a folder on the c drive (that part im having no issue with )only issue i have is when i try to run the batch to make the task on a different pc then the one i created it on i get a message saying "error: no mapping between account names and security ID's was done <17,8>:logon type
i plan on just popping in the flash drive and running these scripts as i go around doing the preventive maintenance or wile im on a pc to troubleshoot an issue
here are my scripts
this one is run off the flash drive and creates a folder on the c drive i have no issues with that but im posting it just as a reference
@echo off
REM Check if 32 or 64-bit OS
if "%Processor_Architecture%"=="" goto oscheck
if "%Processor_Architecture%"=="x86" goto x86
if "%Processor_Architecture%"=="AMD64" goto x64
:x64
mkdir c:\autocleaner
copy createtask64bit.bat c:\autocleaner\
copy createtask32bit.bat c:\autocleaner\
copy autoclean32bit.xml c:\autocleaner\
copy ccleaner64.xml c:\autocleaner\
echo Everything was copied to \autocleaner to be installed
eject
pause
exit
after that i go to the autocleaner folder on the c drive and then run the other script either the 32 bit or 64 bit depending on the pc
both scripts are the same only diffence is what xml file it points to
schtasks /create /tn "ccleaner64" /xml "c:\autocleaner\ccleaner64.xml"
PAUSE
any suggestions ? id also like to be able to do this from one of our network drives
i can also attach the scrips and xml files if needed
thank you