Quantcast
Channel: Group Policy forum
Viewing all articles
Browse latest Browse all 19997

Unable to create Task scheduled for Windows 7 machines

$
0
0

Hi,


Try to use gpo to cretae a TS which runs a script when user logins to delete user data from desktop, my documents ect...

The script works fine when running it self.

ts SETTINGS.

General

  • Name : Delete Data - User
  • When running the task, use the following user account: BUILTIN\USERS

Triggers

  • At log on

Actions

  • Start a program: "C:\Users\Data to delete.bat" (i try it with speech marks and without)

Condition/Settings/ Common: no changes made

The file does existed in C:\users\ folder

This is the error i get on PC.

The user 'Delete Data - User' preference item in the 'Test Security {xxxxxxxx}' Group Policy object did not apply because it failed with error code '0x80041318 The task XML contains a value which is incorrectly formatted or out of range.' This error was suppressed.

The user 'Delete Data - User' preference item in the 'Test Security {xxxxxx}' Group Policy object did not apply because it failed with error code '0x80041318 The task XML contains a value which is incorrectly formatted or out of range.' This error was suppressed.

SCRIPT:

@echo off

del %userprofile%\Desktop\*.* /s /q
del %userprofile%\My Documents\*.* /s /q
del %userprofile%\Downloads\*.* /s /q
del %userprofile%\Favourites\*.* /s /q
del %userprofile%\My Pictures\*.* /s /q

for /d %%x in (%userprofile%\Desktop\*) do @rd /s /q "%%x"
for /d %%x in (%userprofile%\My Documents\*) do @rd /s /q "%%x"
for /d %%x in (%userprofile%\Downloads\*) do @rd /s /q "%%x"
for /d %%x in (%userprofile%\Favourites\*) do @rd /s /q "%%x"
for /d %%x in (%userprofile%\My Pictures\*) do @rd /s /q "%%x"


Viewing all articles
Browse latest Browse all 19997

Trending Articles