Task Scheduling With Batch File Question

captainfearless

New member
Local time
7:45 PM
Messages
23
Hi everyone,

I've recently been setting up some automation via TS with great success, until now.

I want it to delete daily all content, sub folders and files etc from my TV shows parent folder.

I am using the following shell script (.cmd batch file)

@echo off
setlocal enableextensions
if {%1}=={} goto :HELP
if {%1}=={/?} goto :HELP
goto :START

:HELP
echo Usage: %~n0 directory-name
echo.
echo Empties the contents of the specified directory,
echo WITHOUT CONFIRMATION. USE EXTREME CAUTION!
goto :DONE

:START
pushd %1 || goto :DONE
rd /q /s . 2> NUL
popd

:DONE
endlocal


from this link Create Batch file to delete files and subfolders, but not root folder

I have it set up thus "C:\Scripts\CleanDir.cmd" \\Users\Administrator\Downloads\Deluge Completed in TS, and it has set everything after the commas as the argument.

It runs, it provides the result (0x1 the same as other tasks that do work), but nothing is deleted.

Can any more experienced user tell me what i'm doing wrong please? I'm guessing it's a comma or gap thing, something simple!
 

My Computer

Computer Manufacturer/Model Number
CCL 1010 AMD Base Unit
OS
Windows 7 Ultimate x64
CPU
AMD Athlon 64 x2 Dual Core Processor 5200+ 2.70
Memory
2.0gb
Graphics Card(s)
Sapphire HD5450 1GB DDR3
Sound Card
Sapphire HD5450 1GB DDR3
Monitor(s) Displays
sony 40" tv
Hard Drives
1 tb western digital
Cooling
Zalman cnps7000c super flower cooler
Are you running the .BAT file with elevated (administrator) privileges?
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Golden Mk. I.4
OS
Windows 10 Pro x64 ; Xubuntu x64
CPU
Intel i7 860 @ 2.80 GHz O/C'ed to 4.0GHz
Motherboard
Gigabyte P55A-UD3R Rev.1. Award BIOS F13
Memory
16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24)
Graphics Card(s)
EVGA NVidia GTX 560 1024MB
Sound Card
Realtek Integrated
Monitor(s) Displays
Dual Samsung SyncMaster 2494HS
Screen Resolution
1920*1080 and 1920*1080
Hard Drives
1*Samsung 840 EVO 120GB SSD;
1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
1*Samsung F1 SpinPoint 1TB;
2*Western Digital 1TB External USB 3.0
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0
PSU
Thermaltake ToughPower QFan 750W
Case
Thermaltake Element S VK60001W2Z
Cooling
Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans
Keyboard
Logitech G110
Mouse
Logitech MX518
No! Only logged in as administrator with full power so that may be it , I'll try tonight thanks.
 

My Computer

Computer Manufacturer/Model Number
CCL 1010 AMD Base Unit
OS
Windows 7 Ultimate x64
CPU
AMD Athlon 64 x2 Dual Core Processor 5200+ 2.70
Memory
2.0gb
Graphics Card(s)
Sapphire HD5450 1GB DDR3
Sound Card
Sapphire HD5450 1GB DDR3
Monitor(s) Displays
sony 40" tv
Hard Drives
1 tb western digital
Cooling
Zalman cnps7000c super flower cooler
Drat, this has not fixed it, restarted just to be sure.
 

My Computer

Computer Manufacturer/Model Number
CCL 1010 AMD Base Unit
OS
Windows 7 Ultimate x64
CPU
AMD Athlon 64 x2 Dual Core Processor 5200+ 2.70
Memory
2.0gb
Graphics Card(s)
Sapphire HD5450 1GB DDR3
Sound Card
Sapphire HD5450 1GB DDR3
Monitor(s) Displays
sony 40" tv
Hard Drives
1 tb western digital
Cooling
Zalman cnps7000c super flower cooler
Sorted it using 3rd party software in the end.
 

My Computer

Computer Manufacturer/Model Number
CCL 1010 AMD Base Unit
OS
Windows 7 Ultimate x64
CPU
AMD Athlon 64 x2 Dual Core Processor 5200+ 2.70
Memory
2.0gb
Graphics Card(s)
Sapphire HD5450 1GB DDR3
Sound Card
Sapphire HD5450 1GB DDR3
Monitor(s) Displays
sony 40" tv
Hard Drives
1 tb western digital
Cooling
Zalman cnps7000c super flower cooler
Back
Top