LabTech Support Forums

File Delete Issue

This forum is for discussion of expansion script related issues.

Moderator: jware.connectwise

File Delete Issue

Postby neadom.kotoritechnologies » Wed May 18, 2011 9:23 am

I am running a script that deletes two Vipre xml files However when I run the script I get:
ERR and error occured: Illegal characters in path.

My script runs the following:
File Delete as Admin
%systemdrive%\ProgramData\Sunbelt\AntiMalware\AgentSettings.xml

File Delete as Admin
%systemdrive%\ProgramData\Sunbelt\AntiMalware\Policy.xml

I got it to work if i run a shell as admin command:

del %systemdrive%\ProgramData\Sunbelt\AntiMalware\AgentSettings.xml

and

del %systemdrive%\ProgramData\Sunbelt\AntiMalware\Policy.xml

Why won't the file delete work?

Neadom
neadom.kotoritechnologies
Newbie
Newbie
 
Posts: 32
Joined: Thu May 05, 2011 7:01 pm
Location: Goose Creek, SC

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 2:47 pm

Have the same issue using file delete. I'm trying to build a script to clear the Eset cache for update troubleshooting. Using File delete to remove all files like em001_32.dat but with any number. So, this just give Illegal Characters in path:

DELETE: %ProgramFiles%\ESET\ESET NOD32 Antivirus\em0**_32.dat

I wish I could see a bit more detail in the documentation about how to do this though.

Ed
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm

Re: File Delete Issue

Postby ryan.alait » Mon Apr 02, 2012 3:01 pm

Have you tried encapsulating it in parenthesis? "%ProgramFiles%\ESET\ESET NOD32 Antivirus\em0**_32.dat" normally you need to do that if there is spaces in your path.
ryan.alait
Jr. Member
Jr. Member
 
Posts: 54
Joined: Wed Apr 13, 2011 12:43 pm

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 3:45 pm

Yes, I have tried that. As I understand it, LabTech control does not accept quotes anymore. That would work from the command line but doesn't work from LT scripts. I get the same error.
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm

Re: File Delete Issue

Postby ryan.alait » Mon Apr 02, 2012 3:47 pm

If you are running this comman as Shell it should be running it as a command line, I will test this and let you know.
ryan.alait
Jr. Member
Jr. Member
 
Posts: 54
Joined: Wed Apr 13, 2011 12:43 pm

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 4:08 pm

Not running it as a shell command. I'm using the function File delete. But, I have tried it as a shell command like this:

Shell: echo Y | DEL "%programfiles%\Eset\eset Nod32 Antivirus\em0**_32.dat" /f /q

But that didn't work either.
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm

Re: File Delete Issue

Postby ryan.alait » Mon Apr 02, 2012 4:10 pm

running the script with a command as shell: del "C:\Program Files (x86)\space folder\space*.txt" where space*.txt was a file called space01.txt this command completed successfully and the file was deleted. Try using one asterisk maybe.
ryan.alait
Jr. Member
Jr. Member
 
Posts: 54
Joined: Wed Apr 13, 2011 12:43 pm

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 4:14 pm

OK, that gives me "Output: Access is denied"
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm

Re: File Delete Issue

Postby ryan.alait » Mon Apr 02, 2012 4:20 pm

This may have to be done as an administrator then. Lots of Antivirus programs will lock their files down.
ryan.alait
Jr. Member
Jr. Member
 
Posts: 54
Joined: Wed Apr 13, 2011 12:43 pm

Re: File Delete Issue

Postby ryan.alait » Mon Apr 02, 2012 4:23 pm

Unlikely this will work but try a command to move the file to a public folder somewhere and then delete it.
ryan.alait
Jr. Member
Jr. Member
 
Posts: 54
Joined: Wed Apr 13, 2011 12:43 pm

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 5:07 pm

Ryan,

Thanks for your help. You're correct as it didn't work even if I try to move it. I would guess it may work if I stop the eset services first. I honestly don't know if these files are critical to delete to get updates working again. I have the script deleting %programdata%\Eset\eset Nod32 Antivirus\Updfiles directory and %programdata%\eset\Eset Nod32 Antivirus\Charon directory. Strange that the function File Delete doesn't work but the Folder Delete does work. I'll just leave out the em0**_32.dat files and see if theat fixes the update issue.

Ed
Last edited by echavez.oi-group on Mon Apr 02, 2012 5:32 pm, edited 1 time in total.
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm

Re: File Delete Issue

Postby ryan.alait » Mon Apr 02, 2012 5:12 pm

What solved the original error, removing the additional asterisk?
ryan.alait
Jr. Member
Jr. Member
 
Posts: 54
Joined: Wed Apr 13, 2011 12:43 pm

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 5:25 pm

I believe it was the double asterisk. Thanks.
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm

Re: File Delete Issue

Postby echavez.oi-group » Mon Apr 02, 2012 6:12 pm

Ryan,

The em0**_32.dat files cannot be deleted due to Eset's self defense mechanism. That would have to be disabled for the script to work. No fault of the LT script, well, the shell command anyway.

Ed
echavez.oi-group
Newbie
Newbie
 
Posts: 11
Joined: Wed Dec 31, 1969 8:00 pm


Return to 29B. Scripts

Who is online

Users browsing this forum: No registered users and 1 guest