Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to delete a file in SQR (Process Scheduler)

How to delete a file in SQR (Process Scheduler)

How to delete a file in SQR (Process Scheduler)

Hello everyone.

I'm running a routine in a SQR program to delete a file after it processes it. In SQRW works perfectly, but when I run the program through the System Process Request even though I have a successful return on the <call system using> command, the file is not deleted.

I have used the following commands:
1st try
let MyFile= d:\path_to_file\outputfile.txt
...program lines
let #MyResult= delete($MyFile)

2nd try
let $command= getenv('COMSPEC')||' /c del /q '||$MyFile
call system using $command #MyResult

3rd try
let $PS_PATH= 'd:\path_to_file\'
let $command= getenv($PS_PATH)||' /c del /q outputfile.txt'
call system using $command #MyResult

4th try
let $command= getenv($PS_PATH)||MyBatFile.bat
call system using $command #MyResult
where MyBatFile.bat:
cmd.exe /c del /q outputfile.txt
The .bat file is located where the file to be deleted is
-------------- ----------------------
I believe I'm working in Windows environment. Would it be different if it is Unix?

Any suggestions will be greatly appreciated.


RE: How to delete a file in SQR (Process Scheduler)

things to check...Assuming this is being run on the App server, make sure your App Server has access to the location you are deleting the file from and that permissions allow for deletion. The "successful" status basically means the job didn't abort.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close