Over 1 million tech questions and answers.

creating a batch script to create a scedualed task on multiple pc's

Q: 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

RELEVANCY SCORE 200
Preferred Solution: creating a batch script to create a scedualed task on multiple pc's

I recommend downloading and running Reimage. It's a computer repair tool that has been proven to identify and fix many Windows problems with a high level of success.

I've used it in the past to identify and fix everything from blue screens (BSOD's), ActiveX errors, corrupt files and processes, dll/exe/sys errors, recover lost memory, Windows update problems, defragging, malware removal etc.

You can download it direct from this link http://downloadreimage.com/download.php. (This link will automatically start a download of Reimage that you can save to your computer.)

A: creating a batch script to create a scedualed task on multiple pc's

Hi there,









Quote: Originally Posted by joeykong


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


Is this the only issue?

It's not a problem with batch but with Task Scheduler. Before you can import a task that originated from another computer, data contained in the "UserId" element of the task xml has to be changed to match up with a user that exists on the machine you are importing the task to.

E.g.

Code:
<Principals>
<Principal id="Author">
<UserId>COMPUTERNAME\Username</UserId>
<LogonType>InteractiveToken</LogonType>
<RunLevel>LeastPrivilege</RunLevel>
</Principal>
</Principals>
The part in red must be changed to one of the users of the machine you are trying to importing this task to.

Read other 2 answers
RELEVANCY SCORE 100.8

Hello!

I'm having trouble creating a batch script to simply copy a shortcut to the desktop from a program installation, then carry out some tasks.

Overall my goals are:
Burn a CD that includes a autorun.inf that will load a batch script
In the script I want it to activate two self extraction archives
1.
activate a self-extraction archive to install the necessary files to C:\Program Files (x86)\Software
2. (once 1. completes)
activate a self-extraction archive to install the necessary files to C:\Program Files (x86)\Software\Content

Then finally have the batch script create a shortcut from C:\Program Files (x86)\Software\Softwarename.exe
to
%userprofile%\Desktop\softwarename.ink

Any advice will be appreciated. thanks in advance..

A:Creating a batch script or use a 3rdpartyprogram to create shortcuts

Still looking for a solution!

Read other 4 answers
RELEVANCY SCORE 91.6

Hi,
Can anyone help me how to create a batch file or vbs script to install multiple windows patch (.exe) file from a network share folder. Also I want get the individual log file of all user including hostname.
So please help me because we need to deploy multiple patches in around 100 PC and we are not using any WSUS  server and windows automatic update.

Thanks & Regards
Rakesh Kumar

Rakesh Kumar

Read other answers
RELEVANCY SCORE 76.4

I have the following batch script


Code:
@echo off

setlocal enableextensions

set "baseName=dnshistory"

set "count=0"
for /f "delims=%baseName%." %%a in (
'dir /b /o-d "%baseName%*.txt" 2^>nul'
) do ( set /a "count=%%a+1" & goto saveData )

:saveData
ipconfig /displaydns | find "Record Name" > "%baseName%%count%.txt"
The problem is that when i run it on my windows 7 desktop, it creates an empty txt file in comparison to my windows 8 laptop, where it creates the dns record that i need.

Does anyone knows why this happens on windows 7 ?

A:Windows 7 creating blank txt file after running a batch script

Usually inserting a bunch of "echo" statements will give a hint what's wrong. Just like using MsgBox in other programming languages.

Read other 3 answers
RELEVANCY SCORE 76.4

I want to create a batch script which can search for .jpg and .jpeg

I am new to this script language, so don't no how to search, so I am posting this thread here.

Please can anyone tell me the batch script which can search all drives and folders and subfolders in a computer for .jpg and .jpeg, once found they must get copied.

Please help me with this, please give me the script code for this.

Read other answers
RELEVANCY SCORE 75.6

Create a batch script for Oracle ODBC connection
 

Read other answers
RELEVANCY SCORE 75.6

Hello,

I have the following batch file that works great, until I happen to execute it on a file with a + in it.

@echo off
cls
for /r %%f in (*txt) do copy %%f m:\text files

I searched around for a bit, but I couldn't get any of the information I found about escape characters to work. How can I make the batch file treat the file name in %%f as a literal?

Thanks!
 

A:Batch script to create files with special characters

Read other 10 answers
RELEVANCY SCORE 75.6

Hi everybody - My problem is that I have 100 identical printers, all the printers have network connectivity onboard.

I want to create 100 print queues for these printers, however I don't really want to add each lpr port/print queue manually !! Is there anyway that this can be done via script or batch file ??

Thanks in advance

Ron
 

Read other answers
RELEVANCY SCORE 74.8

I was wondering if there was a way to create a set of folders in a specific directory according to a date range that i input.

ie.

Select start date 2011 10 01

select end date 2012 10 01

Select Output path of c:\users\XXXX\desktop\export data

and it creates a folder for all days from 2011 10 01 through 2012 10 01 and places them in the output path i have set for it.

any help would be greatly appreciated.

Thank you

A:Is there a Script or batch file that can create folders by date range

Welcome damjohnron to the windows 7 forums.

Here are some snippits of a dos batch file that will create a directory with the datek and tell you if it already exists.


set DATEST=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
echo %datest%
rem if it looks ok, then you can press enter to continue
pause
if exist %homepath%\documents\%datest% goto dup1
md %homepath%\documents\%datest%
rem the pause can be taken out if you wish.
pause
go to end
:dup1
rem you already have done this.
pause
:end

you can change the path statement to the directory you wish.

This batch file can be run each day that you want to create a new sub directory.
There are other ways to do this but a bit more complicated such as reading an external
text file for the directory names.

Rich

Read other 4 answers
RELEVANCY SCORE 72.4

Hi

I am trying to open a program (Caseware), export from it for a specific file, and then repeat the process across a series of these files. once in a useable format I need to report across the exports.

I think from reading posts I can use a batch file to open a specific file using a specific software package, Is there a way then to use specific keystrokes inside the package to do the export, then close the file and repeat on the next file.

I may need to put a pause in to the batch file, as the sowftare can take up to two minutes to load a file.

Any help or advice would be much appreciated as otherwise I'll be stuck doing it manually for ever :-(

Best

D
 

Read other answers
RELEVANCY SCORE 72

Hello! I have a virus on my laptop computer that was transmitted through a flash stick from a friends laptop.

the virus is all about recreating two folders, one with my windows user name and the other is new folder, there's also a script running the task manager.

Read other answers
RELEVANCY SCORE 72

Hello,
I am trying to schedule a task while loads MySQL batch script (.sql) file but the command is not executing as given and expected. Rather it's printing MySQL help usage information. My task action configuration would be:
Program/Script: "D:\Workspace\Tools\mysql-5.6.25-winx64\bin\mysql.exe"
Arguments: -u username -ppassword <databaseName> < "D:\<batch-script-file-name>.sql"

It's running successfully while running through command prompt but not working using task scheduler. Rather it give mysql help usage information. Any idea about it's behavior?
Thanks

A:Using Windows 7 Task Scheduler To Load MySQL Batch Script File

Instead of scheduling mysql.exe, you should schedule a batch file that contains the whole command and its parameters. This makes debugging much easier. Let's call the batch file D:\Workspace\MyBatch.bat:
MyBatch.bat
@echo off
set Log=d:\Report.log
echo Job run on %date% at %time% by %UserName% >> %Log%
D:\Workspace\Tools\mysql-5.6.25-winx64\bin\mysql.exe -u username -ppassword d:\MyDatabase D:\MyScript.sql  1>%Log  2>&1
echo. >> %Log%
You should now do this:

Run the batch file from a Command Prompt.
Examine the log file.Run the batch file from the Task Scheduler.Examine the log file again.

Read other 4 answers
RELEVANCY SCORE 72

Hi all,

I'm trying to make a batch or powershell file that will call multiple names and passwords from a CSV file and then create local users with them.

Anyone able to help? - I've made users in command line before using the Net User command, but i'm not sure how to use the variables to say read the data from this spreadsheet, then add a user with it.

Any help would be gratefully received!

Thanks
Matt
 

A:Batch / Powershell script to add multiple Local users

i found this from when i used to do sysadmin,

Code:
###########################################################
# AUTHOR : Marius / Hican - http://www.hican.nl - @hicannl
# DATE : 26-04-2012
# COMMENT : This script creates new Active Directory users
# including different kind of properties based
# on an input_create_ad_users.csv.
###########################################################
Import-Module ActiveDirectory
# Get current directory and set import file in variable
$path = Split-Path -parent $MyInvocation.MyCommand.Definition
$newpath = $path + "\import_create_ad_users.csv"
# Define variables
$log = $path + "\create_ad_users.log"
$date = Get-Date
$i = 0
# Change this to the location you want the users to be created in your AD
$location = "OU=Test,OU=Users,DC=hican,DC=nl"
# FUNCTIONS
Function createUsers
{
"Created following users (on " + $date + "): " | Out-File $log -append
"--------------------------------------------" | Out-File $log -append
Import-CSV $newpath | ForEach-Object {
# A check for the country, because those were full names and need
# to be landcodes in order for AD to accept them. I used Netherlands
# as example
If($_.CO -eq "Netherlands")
{
$_.CO = "NL"
}
# Replace dots / points (.) in names, because AD will error when a ... Read more

Read other 1 answers
RELEVANCY SCORE 72

hi so work in an recruitment office and im trying to create a batch file that the computers can run on a schedule to create a folder with that days date on it and move all files from the desktop to that folder( also created on the desktop), i want the code to only move files and leave folders and shortcuts unaffected

this is what i've got so far.






Quote:
cd desktop

for /f "tokens=1-3 delims=/" %%a in ("%date%") do md "%%a_%%b_%%c"
mkdir c:\users\training\desktop\%date:/=%

MOVE c:\users\training1\desktop\*.* c:\users\training1\desktop\%date:/=%


right now it is making the folder but not moving anything i know it has something to do with the \%date:/=%

il need this batch file to run from a hidden location so that 1. the students dont mess with it and 2. so the batch doesn't move itself from the desktop. also the computers all have different user names so if i could get something that will make "training1" what ever the current logged in user is so i don't have to rewrite the batch for each of the 60 or so computers we have.

A:batch&task to create new folder and move all desktop file to it

Especially with files and folders I find AHK easier to figure out than batch. You can download the free AutoHotkey scripting language here:
AutoHotkey

Here is a script to get you started. I commented out the actual deletions. You can run it and see the desktop files that would be moved in a msgbox. Each loop it asks if you want to quit to escape the tedium. Once you are sure it will work as expected comment out the lines with msgbox and uncomment the FileMove line

If anything gets moved into the folder that shouldn't be you can just drag it back during testing. The variable A_Desktop is the user's desktop directory so the script should work without editing as far as that goes.

Note: free to use at your own risk.


Code:
FormatTime,FolderName,,yyyy_MM_dd
FolderName := A_Desktop "\" FolderName
FileCreateDir,%FolderName%
Loop %A_Desktop%\*.*
{
If (A_LoopFileName = "desktop.ini")
continue
If (SubStr(A_LoopFileName,-3) = ".lnk")
continue
; FileMove,%A_LoopFileLongPath%,%FolderName%
MsgBox % A_LoopFileName
MsgBox, 4388, Quit Loop, Quit Loop?
IfMsgBox,Yes
ExitApp
}

Read other 5 answers
RELEVANCY SCORE 72

hi all,

I am working as a system administrator around with 90 systems and using server 2003.all systems are windows xp

I want to shutdown all 90 systems at once.it can be possible with batch file using "SHUTDOWn" command
I worte the batch file using that command but it is not working

My Batch file like this

Shutdown -s -m \\Test1 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"
Shutdown -s -m \\Test2 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"
Shutdown -s -m \\Test3 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"
Shutdown -s -m \\Test4 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"

this is my batch file.this is not working...please help me..

Note: When i exceute the same command form command prompt it will work fine...for that i have to type that same command for 90 times to shutdown all compters.

i am using another batch file..it shows like this...

@Echo off
cd\
Echo bunny=Program
REM ****************************
REM * Program Variables *
REM ****************************

set varcomputer=Test1
goto loop
:Test1

set varcomputer=Test2
goto loop
:Test2
Exit

REM ****************************
REM * Program *
REM ****************************

:loop
echo Shutting down %varcomputer%.
shutdown -s -m \\%varcomputer% -t 600 -c “The computer is shutting down. Please save your work.”
goto %varcomp... Read more

A:Problem when creating batch file for shutdown multiple computers in LAN

Since the command line version works, Here's a BAT file that opens a shell for each command. I use this all the time for running different instances of robocopy. Should work for you.

------- shutitdown.bat -------
Set WshShell = wscript.createobject("wscript.shell")
wshshell.run("shutdown -s -m \\test1....")
wshshell.run("shutdown -s -m \\test2....")
-----------------------------------------
 

Read other 2 answers
RELEVANCY SCORE 71.6

Hey there,

How can I create multiple folders in Outlook 2007? Specifically, I have a list of 50 names, and I want to create a folder for each, in one batch.

Is this possible? Any suggestions?

TIA
 

Read other answers
RELEVANCY SCORE 70.8

Hi,

I'm trying to create a batch file so that I can bring up 2 sites at one time when I open my browser. I use Firefox & IE8.
What I have done so far to no avail is created a file as follows and sent to desktop from notepad named test.bat:

@echo off
start "(web site)" "www.(site).com"
start "(web site)" "www.(site).com

without parenthesis in the above. I can get these to open consecutively, same browser window if I have a browser already open. But, not without browser open. How do I connect the 2 sites to open in 2 tabs, same window?

I also added them as multi home pages, then sent shortcut to browser to desktop. This does work, but, not what I want.

Is there anyway to create a batch file and have these 2 sites open at start up, by-passing the desktop without clicking to open the browser?

Also, I know that clicking on the shortcut to the browser that's on the desktop does slow down the launching process. If there is another way upon start up, will it be slower as well?

Thanks,
bbbluz

A:Create Batch file for multiple sites to start

start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.(site).com
start /d "C:\Program Files\Internet Explorer" IEXPLORE.EXE www.(site).com

Mozilla Firefox always opens two links in two different windows from a command line. There's no way around that. Sorry.

Read other 8 answers
RELEVANCY SCORE 70.8

i saw an article on tech t.v. how to create a batch file to launch multiple programs, so i went into notepad, typed the paths of three programs i use every day at work, named it work.bat placed it on my desktop, but when i double click it the programs dont launch. an msdos window opens and lists the programs i want to launch, but nothing else happens, what am i doing wrong?
 

A:create a batch file to launch multiple programs

Read other 7 answers
RELEVANCY SCORE 70.4

Hi to all,
I would like to create a powrshell script that will exectute a scheduled task on Windows 7 X64.I tried to find it on Internet without solving my problems.Please find below the description of what i want.
Purpose: Create Powershell script to run a scheduled task

What does the scheduled task do? Execute the following command when starting the PC: 

Regsvr32 /s C:\Windows\SysWOW64\oleacc.dll
with the system account of the machine concerned.This task is performed when the PC is restarted.
i'm a beginner in powershell.
THank you for your help.
Regards,

Read other answers
RELEVANCY SCORE 70.4

Hi Everyone,

I have 500 files coming in and I need to first check if any file(s) exist then rename all of them regardless of what their filename is (the files are named in a different language).

No need to process them in any order.

Rename:

1. ??X?d?f-20110703-?+?d?H?-?-?=??.xls?
2. ??X?d?f-20110707-?+??-+?8.xls?
3. ??X?d?f-20110707-?+???j??.xls?
4. ??X?d?f-20110708-?+???M?n.xls?
5. ??X?d?f-20110713-?d?O?n?h?P.xls?
.
.
.
500


To:

?TWN_CH_INV_VISIT_FORM_01.xls?
?TWN_CH_INV_VISIT_FORM_02.xls?
?TWN_CH_INV_VISIT_FORM_03.xls?
?TWN_CH_INV_VISIT_FORM_04.xls?
?TWN_CH_INV_VISIT_FORM_05.xls?
.
.
.
?TWN_CH_INV_VISIT_FORM_500.xls?


Hope you could help me on this one. I?ve been trying to do this for weeks.


Thanks!

A:How to rename and add incrementing number suffix on multiple files in Batch Script?

You can do this with Windows Explorer for the most part.

If you select a bunch of files and then right click and chose rename, you can type in what you want the base file name to be and then windows will take care of adding the number to the end of the file.

HOW TO: Rename Multiple Files in Windows XP with Windows Explorer

Read other 1 answers
RELEVANCY SCORE 70

Hi everyone. 
I want to create a batch file(*.bat) that can auto install some of my programs from my CD silently. Actually i own a cyber-cafe and i format my computers once a week. After formatting and re-installing XP, i install some programs like Adobe reader
10.1.1, Google Chrome, Microsoft Office 2003, File formats converter, google chrome, mozilla firefox which you know is a necessity for a cyber cafe user. Installing a program one by one takes a lot of time and somehow frustrating. So i want it to be automated.
I am posting a screen-shot so that it would be easy for you to figure out the issue. 

Thanks & Regards, Amol . Amol Dhaygude

Read other answers
RELEVANCY SCORE 69.2

Is there any body who can create a batch file to install multiple  *.msu  files in running system (windows 8.1/windows
7sp1)?

A:Create a batch file to install multiple *.msu files in running system

See the article below, basically you can use the WUSA command line to install your updates quietly.

http://support.microsoft.com/kb/934307

Be kind and Mark as Answer if I helped.

Read other 3 answers
RELEVANCY SCORE 64
A:In Task Scheduler, what's the difference between Create Basic Task and Create Task?

Hello Advice Pro,

While both will allow you to create a task, the "Create Basic Task" is done through a wizard and does not have all of the advanced options as doing it manually with the "Create Task" one instead.

Hope this helps,
Shawn

Read other 1 answers
RELEVANCY SCORE 62

I am having a problem with a batch script that prompts a user to enter a set of responses which then set variables - Then the script will call in another batch and writes the output to a new Batch file.

The problem is the batch file doesn't output the new Batch file the way I intended.

This is the script I have:

BEGIN.BAT

:START
@ECHO OFF
CLS
ECHO.
ECHO Please enter the full filename reference (e.g. 1-210208)
ECHO.
SET REFERENCE=
SET /P REFERENCE=
CLS
ECHO.
ECHO Please enter the full description (e.g. 12:15 on Thursday 21 FEBRUARY 2008)
ECHO.
SET Description=
SET /P Description=
CLS
ECHO.
ECHO Please enter the date reference (e.g. 210208)
ECHO.
SET DTE=
SET /P DTE=
CLS
ECHO.
ECHO Please enter the reservation slot time (e.g. 1215)
ECHO.
SET TME=
SET /P TME=
CLS
ECHO.
ECHO Please enter the script file you are replacing (e.g. 001)
ECHO.
SET Replace=
SET /P Replace=
CLS
ECHO.
ECHO Please enter the continuing script file (e.g. 002)
ECHO.
SET NxtFile=
SET /P NxtFile=
CALL "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\ADMIN\TEMPLATE.CMD">"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\DATES\%Replace%.BAT"
CLS
ECHO.
ECHO REPLACEMENT OF %Reference% completed!
PAUSE
GOTO START

TEMPLATE.BAT

ECHO @ECHO OFF
ECHO CLS
ECHO IF EXIST "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT" (
ECHO GOTO NEXT
ECHO ) ELSE (
ECHO GOTO EXIST
ECHO )
ECHO :EXIST
ECHO ECHO.
ECHO ECHO %DESCRIPTION% IS AVAILABLE
E... Read more

A:Help with Batch script that creates a Batch script

Try This

Template.Bat
Code:

@ECHO OFF
CLS
IF EXIST "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT " (
GOTO NEXT
) ELSE (
GOTO EXIST
)
:EXIST
ECHO.
ECHO %DESCRIPTION% IS AVAILABLE
ECHO.
ECHO Would you like to reserve this time?
ECHO.
ECHO Yes (Y) or No (N) or Cancel (C)
ECHO.
:ERROR
SET CHOICE=
SET /p CHOICE=Enter response to continue (Case sensitive):
IF not '%choice%'=='' set choice=%choice:~0,1%
IF '%choice%'=='Y' goto YES
IF '%choice%'=='N' goto NEXT
IF '%choice%'=='C' goto CANCEL
ECHO "%choice%" is not valid please try again
ECHO.
GOTO ERROR
:YES
ECHO %DESCRIPTION%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\ %REFERENCE%.TXT"
ECHO RESERVED BY %FullName%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT"
ECHO LOCATED ON %Team%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT"
ECHO STAFF ID IS %USERNAME%>>"\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\%REFERENCE%.TXT"
ECHO "%DATE%","%TIME%","%USERNAME%","%FullName%","%Team%","%DTE%","%TME%">>"\\hb eu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\LOG\AUDIT.CSV"
ECHO.
ECHO Thank you %FullName% - Your reservation has been successful.
ECHO.
PAUSE
:NEXT
CALL "\\hbeu\DfsRoot\GB002\Retail\405447\SYSTEMS\SHARED\INET\ONE\DATES\002.BAT&quo... Read more

Read other 3 answers
RELEVANCY SCORE 60.8

I have read a lot of other forums about scheduled tasks running twice, unfortunately the hot fix does not fix the issue. 

Hotfix
I checked in C:\windows\system32\tasks, the solution is not here.
I also checked in the registry, was not able to find the duplicate task, I was able to find the task in /windows NT
This happens in a very specific scenario.  We have to update the time triggers for a specific scheduled task based off when a store closes.  They close later on the weekends so the 1st task "autoupdate" will look at an xml file to determine
if the store close time has changed.  Since the store close time changes, it then recreates the "store close" scheduled task with the new time triggers found in the xml.  Autoupdate does this by looking at a .config file we wrote.

Unfortunately this config file had an issue with the path to the store close task not being case sensitive.  When the Autoupdate task kicks off, if replaces the store close task with the correct time triggers, but now the store close task runs twice
at each time trigger
Example
We have a task folder \Hello World
The config file paths out to the task as \Hello world (notice the lowercase w).
This causes the time triggers to kick off 2 task, 1 for (\Hello World\Store close) and another for (\Hello
world\Store close)

I got this to trigger 3 times by changing the .config file to path out to \hello
world.  Now every time the time trigger... Read more

Read other answers
RELEVANCY SCORE 60.8

Question: Is the (Synchronize across time zones) check box necessary to use, when modifying the task settings?
I see "irregular" start times when the task is triggered for defragmenting of local disk drives.

Lee Payne

Read other answers
RELEVANCY SCORE 56.4

I started using the Task Scheduler to defrag the local disk drives, by (creating task) & (creating basic task) from the scheduler console, That's (2) types of task to make sure it works. 

Problem: The tasks do "trigger" after modifying settings, but at "irregular" start times and sometimes not-at-all.
I see the (Synchronize across time zones) check box at the (trigger tab), to wonder if checking the box will cause irregular start times.
Question: Is it necessary  to check mark the (Synchronize across time zones) box, to keep idle start times stable?
Example: A 5:00 AM scheduled trigger that starts at 12:40 PM, to say my OS has "bad" calculation to trigger the task.
Anyway, its been interesting testing (automatic defragmentation), even though I think Microsoft has to "perfect" the task scheduler performance more better.
Sincerely: Lee Vernon Payne - 9/25/2017 - 5:43 PM PST.

 

Lee Payne

Read other answers
RELEVANCY SCORE 56

Hi
I am new to how the task scheduler works. I want to be able to tell the computer to sleep at say 5pm on weekdays and only wake on weekdays from 9am. Between 5pm friday and 9am monday to sleep say after 30mins of idle.
Any help on the above would be much appreciated. Thanks.

A:Creating a task from task scheduler to get the computer to sleep and then wake

Thanks for that.
I found an article that was helpful. Without setting up a batch file.
http://www.howtogeek.com/119028/how-to-make-your-pc-wake-from-sleep-automatically/
The only problem with this is that you have to open a program rather than using a command to suspending sleep. So I may look into using batch files in the future.

Read other 3 answers
RELEVANCY SCORE 56

Hello everyone,

I need to have a task run that will move the contents of a folder from one computer to another over my home LAN. Files get downloaded during the night on one computer and then need to be transfered to another. Usually I am doing this by hand, but then though maybe I could get the task scheduler to do it for me.
I understand how to create a task, however I am having trouble with the action tab. I was thinking that I should start windows explorer (where is explorer located for win 7 x64 machines?) under the action tab, but once I do this I am not sure how to tell explorer to check the source folder, select all the files in it and then move it to the target folder.

I took a look through the tutorials of the forum, but didn't find what I was looking for. If you can help or just point me to more resources that would get me going I would be thankful.

Thanks in advance.
Steve

A:Need help creating a task scheduler task to move files over a network.

So you have two computers, A and B.

A gets the downloads and they are in C:\Downloads (for example).

The name of computer A is CompA and the name of the share for C:\Downloads is Downloads.

You want to move them to computer B in C:\Otherfolder (for example)

If the folder names will always be the same then you can use the move command directly from the scheduled task. You set this up on computer B.

Open Task Scheduler
Under Action, Create basic Task
Name: Move Download Files
Description: Move files downloaded overnight from Computer A to Computer B
Click Next
Select Daily
Click Next
Set date and time
Click Next
Select Start a program
Click Next
In Program/Script box, enter: cmd
In the Arguments box, enter: /c move /Y \\CompA\Downloads\*.* C:\Otherfolder
Click Next
Check the results then click Finish

When this runs, a Command Prompt window will open, the move will take place then the window will close. If you want it to stay open so you can see the results, change /c to /k.

If you want this to run when you're not logged on then under the General tab of Task Scheduler, select Run whether user is logged on or not.

You could also set this up on Computer A by changing things a bit.

Read other 9 answers
RELEVANCY SCORE 55.2

I have read a lot of other forums about scheduled tasks running twice, unfortunately the hot fix does not fix the issue. 

Hotfix
I checked in C:\windows\system32\tasks, the solution is not here.
I also checked in the registry, was not able to find the duplicate task, I was able to find the task in /windows NT
This happens in a very specific scenario.  We have to update the time triggers for a specific scheduled task based off when a store closes.  They close later on the weekends so the 1st task "autoupdate" will look at an xml file to determine
if the store close time has changed.  Since the store close time changes, it then recreates the "store close" scheduled task with the new time triggers found in the xml.  Autoupdate does this by looking at a .config file we wrote.

Unfortunately this config file had an issue with the path to the store close task not being case sensitive.  When the Autoupdate task kicks off, if replaces the store close task with the correct time triggers, but now the store close task runs twice
at each time trigger
Example
We have a task folder \Hello World
The config file paths out to the task as \Hello world (notice the lowercase w).
This causes the time triggers to kick off 2 task, 1 for (\Hello World\Store close) and another for (\Hello
world\Store close)

I got this to trigger 3 times by changing the .config file to path out to \hello
world.  Now every time the time trigger... Read more

Read other answers
RELEVANCY SCORE 54.8

Hi,

I'm not new to Batch Files but i have a requirement that i can't seem to get my head around, I'm sure it must be simple'ish..

I have 2 .txt files (Locations.txt | Files.txt)
Locations is a list of directoriesFiles is a list of file names

I would like to write a Batch Script that would loop through each location in the Locations.txt for files names that match any in Files.txt

I think i may need to write a for loop to cycle through the locations but then i'm not sure how i would pass the file names through for it to check for.

Basically if it does find any of those file names in any of the location i would want it to echo a message.

Regards,
Jamie

Read other answers
RELEVANCY SCORE 54.4

I would like to know how to create a .batch file and have it run at the shut down of the computer,Here are the commands:

netsh int ip reset reset.log
netsh int ip delete arpcache
netsh winsock reset
ipconfig /flushdns

Thanks

A:Creating .batch to run at shutdown

Task scheduler can set it up to run at startup or at login, but I do not see a method to do it at shut down.

You can use the group policy editor since you have Windows 7 Ultimate. See Schedule a task to execute at shutdown or logoff - Tech Support Forum for how to setup a task to run on shutdown using the group policy editor.

Read other 3 answers
RELEVANCY SCORE 54.4

I am totally new to Batch Files. Here is my problem:

I need to create a Batch file that will:
Go to a specific folder on a network drive
Copy a File
Go to another folder on a network drive
replace a file
and then close.

Any help out there as to how to do this?
 

A:Creating Batch File

Read other 7 answers
RELEVANCY SCORE 54.4

how do l create batch file to map an existing file and printter server to the new file and printer server.
 

A:Creating Batch file

Do you mean remap a network drive? If so, you would create a .txt file that looks similar to:

net use h: /d
net use h: \\servername\sharename

Then rename the file to .bat and run it.
The first command deletes the mapped drive h: and the second one maps it.
 

Read other 3 answers
RELEVANCY SCORE 54.4

Hello!

I have created a java application. and I want to give it to my friend who does not have java installed on his machine.So I want to give him java setup and only a jar file of my application.
For that I created batch file as follows:

set path=d:\Test 3\jdk1.6.0_14\bin;%PATH%

SET CLASSPATH=.;d:\jdk1.6.0_14\jre\lib\rt.jar

java -jar "Test3.jar"

Now if my friend puts this Test 3 folder on D drive,then only the application executes.This is obvious I knw.
But there is possibility that someone may or may not have D drive. In this case, what I want to do is, when he copies the folder and paste it anywhere,and just double clicks on the batch file the application should execute.
So is there any method in batch file to get the path of the folder where he has pasted that folder?

Please help me...
 

Read other answers
RELEVANCY SCORE 54.4

Hi there,
Is it possible to recover your windows xp using batch files?
and if it is possible how to create batch files.

Read other answers
RELEVANCY SCORE 54.4

Hi guys,

I have a task from my belkin flip KVM that loses its task icon pretty frequently, but the process is still running.

I've made a batch file

Code:
taskkill -IM flip.exe
this works fine in killing the flip.exe

what i'd like though is kill the exe then pause for 4-7 seconds and then start the flip.exe again. I'm not a programmer in any way, so if anyone can help it would be great.

(it's driving me flipping mad!) LOL

A:creating a batch taskkill?

got reference for a pause...but I'm not sure if I'm implementing it correctly....and the start command just makes the cmd window stay open and flip doesn't start. again syntax is totally wrong me thinks.

Code:
taskkill -IM flip.exe
PING 1.1.1.1 -n 1 -w 5000 >NUL
START "C:\Program Files (x86)\Belkin\Flip\flip.exe"
EXIT
anyone got any ideas?

Read other 2 answers
RELEVANCY SCORE 54.4

edit read below
 

A:Creating a Batch File

I need to write a batch file on a ftp server to do the following:

I have a locally directory on an ftp site, c:/pdf

I want to have this run once to see if new files have been written to it, if they have, move them into say c:/pdf/sent

Then I want to create an error log if any issues arise

Anyone have any experience with this ?
 

Read other 1 answers
RELEVANCY SCORE 54

Hi, I just had a question about a script I'm trying to make for hiding/unhiding folders.

Here is the script I have come up with so far:

Code:
cls if exist "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" goto lock else goto unlock :lock echo off attrib "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" +s +h goto end :unlock echo off attrib "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" -s -h goto end :end exit

For some reason, it works to hide the folder, but when you click it after it hides the folder, it does not reveal the file again,
yet if I run the line "attrib "C:\Documents and Settings\Tom\Desktop\GM Games\folderlock\test" -s -h" in a separate batch file, it works fine...

Theres got to be something wrong with my script that is stopping it from running the "unlock" line...

Any ideas?
 

A:Need help with batch script

Read other 16 answers
RELEVANCY SCORE 54

Hello All,

Greetings!

I am a BI guy.I need a batch script(.bat) for Winodws 7 enterprise edition.
My requirement:
I have some 100 files in a network drive which i can access.Each text file contains some 1000 records with some filed names.Now my question is i want to read those files and put result in another file.I dont want all the record of data in the text file. Now i need filename,record count,date of the file .

result file would be:
Filename record count date
Filename-1 100 01/dec/2017
filename-2 1000 01/dec/2017
filename-3 900 30/nov/2017. This i sthe data i need in a result file(like .csv,exel,.txt as result file)

At same time i have to increment automatically file when new file arrives into the directory.i,e i have executed file today i can see the files upto today.Tomorrow the file should run automatically and update the all files including history files....in the result text.This is because i use this file in a scheduled report in other technology where all these data to display.

I hope you understand.

Thanks in advance.
 

Read other answers
RELEVANCY SCORE 54

I have a batch file I just need ran on and after certain days/dates.. these days vary.

So here is my question..

I want to create a file that I can put in the start up menu, so when my computer boots up it will run this file and check

the date. If the date is for example: november,18,2009 or later it will run the batch file.


That batch file is located in c:\Documents and settings\user\My Documents

So what kind of file would I need to create and what would the script be.

I need to be able to plug in different dates when I need to and using the schedule task in windows is not going to work.

Time doesnt matter just need dates.

A:Script or batch

Welcome to TSF!

This should do it. Set the target date in the 2nd line. Use the same format and symbols as your system does, so if your computer displays the date for Nov 18 as 18-11-2009, use that, not 11/18/2009.

Set the file name of your batch file in the 3rd line. The 4th line is the path to the file, which will be the My Documents folder of the logged on user. If you want this to run for more than one user, you'll need to change that as well, and put the batch file into a folder all users can read.

You can put this batch file in your Startup folder, or create a Scheduled Task to run this batch when you log on.

Code:
@Echo Off
Set _TargetDate=11/18/2009
Set _FileName=mybatch.bat
Set _Filepath=%Userprofile%\My Documents\%_Filepath%
:: Get todays date
Call :GetDate
Set _yy=%_fDate:~,4%
Set _mm=%_fDate:~4,2%
Set _dd=%_fDate:~6,2%
:: Convert todays date to Julian
Call :JDate %_yy% %_mm% %_dd%
Set _JToday=%_JDate%
:: Get Target Date
Call :GetDate %_TargetDate%
Set _yy=%_fDate:~,4%
Set _mm=%_fDate:~4,2%
Set _dd=%_fDate:~6,2%
:: Convert target date to Julian
Call :JDate %_yy% %_mm% %_dd%
If %_JToday% GEQ %_JDate% Start "" "%_Filepath%"
Goto :EOF

::===================================::
:: ::
:: - S u b r o u t i n e s - ::
:: ::
::===================================::
:JDate
:: Convert date to Julian
:: Arguments : YYYY MM DD
::... Read more

Read other 3 answers
RELEVANCY SCORE 54

Hi,
Can somebody assist me with a .bat file I am trying to create?
This is what I have now:


Code:
start /d "C:\Users\Me\Desktop\ghost" ghost.exe
start /d "C:\Users\Me\Desktop" Poweroff.exe

C:\Windows\System32\powercfg.exe /setactive e428f8a5-615e-488f-b7f7-1ed39450e522
The first 2 lines start programs on my desktop. The next line, I try to change the power setting so my computer won't go to sleep, but I am not sure how to put this in my script. When I enter the line in command prompt, it works, but I am new to writing batch files.

What I essentially want to do is to run those two programs and set my power settings to another profile.
The second program shuts down my computer when the first program ends. It would be nice if I could do this in a batch file without the second external program support. Another idea I had was to start up GHost.exe (1st program) and then run shutdown -t 20, but I also need help expressing this in a batch file, so the line runs only after GHost.exe ends.

Thanks for your input.

A:Help me with Batch script!

Oh boy, it's been several years since I did a lot of batch file commands...

Looks like you might want to add the start " " to that 3rd line, thats the 1st thing that comes to mind.

Read other 1 answers
RELEVANCY SCORE 54

how can I start the service: "wireless zero configuration-service"
with a script or batch file?
witch code do I need?

OS Windows XP prof SP2

Thanx Mark
 

A:script or batch

Is it listed in the list of services in the services manager?
 

Read other 2 answers
RELEVANCY SCORE 54

Hey im trying to create a batch script that will create the pattern for IP address's

I started with code that looked like

:loop1
set /a four="%four% + 1"
if ("%four%")==("9") goto loop2
echo %one%.%two%.%three%.00%four%
%cmd% >>"C:\%cmd%.txt"
if not ("%four%")==("9") goto loop1

:loop2
set /a four="%four% + 1"
if ("%four%")==("99") goto loop3
echo %one%.%two%.%three%.0%four%
%cmd% >>"C:\%cmd%.txt"
if not ("%four")==("99") goto loop2

:loop3
set /a four="%four% + 1"
if ("four")==("255") goto loop4
echo %one%.%two%.%three%.%four%
%cmd% >>"C:\%cmd%.txt"
if not ("%four%")==("255") goto loop3

which worked to an extent but once it hit loop3 it would continue adding to the next set of numbers and not reset itself back to 0.

how to i create a bunch of loops for creating the pattern for an ip address (000.000.000.000) from 0-255.

I read into the For /L command but wasnt successful at figuring it out.

Thanks

Read other answers
RELEVANCY SCORE 54

Hi,

I have my vendor's ftp url over SSL. it's like ftps://myvendor.com and i have username and password. So please help me on writing batch script t o downlod the file from my vendor repository.
If this is not possible in dos script, please suggest me opensource tool. But i would love the solution in dos script as i need to use this forever to avoid any manual work.

Thanks

Read other answers
RELEVANCY SCORE 54

dear all
any help to make batch script this the reason i want to make a batch file is to help me update the online games in 60 computers by overwriting or copying big files in one click from 1 source computer...
instead of turning on all 60 computers and updating all online games, he'll just have to update one computer and just copy the update or overwrite the old files in all 60 computers...

i have 1 server game i want only copy newer files to pc all pc client
example
pc server = 192.168.3.200
pc -01 = 192.1683.1
D\gameonline\dota2\
how to batch script

thx before

A:batch script help

i try to make script but no work
this my scripy

@echo off
set "pc_server=\\192.168.3.77\D\GameOnline\DOTA 2\"
set "pc-24=\\192.168.3.24\D\DOTA 2\"
robocopy /"%pc_server%/" /"%pc-24%/" /mir

Read other 6 answers