Date: Wed, 25 Aug 2010 21:46:19 -0400
Reply-To: Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject: Re: X commands
Why do you need the CD command?
Why would you want to write a CSV file into the operating system
One easy way to debug this type of thing is to use a PIPE so you can see
what errors the operating system is throwing at you.
filename schtasks pipe
'c:\windows\system32\schtasks /query /FO CSV /V >tasks.csv';
You might want to remove the >tasks.csv from the command and instead just
use the piped filename to read the CSV output directly into a SAS data step
and save a SAS dataset instead of a CSV file. You could even use a FILE
statement in your data step to right a copy of the output from the schtasks
command to a file.
On Wed, 25 Aug 2010 18:45:11 -0400, Brad Jennings
>I'm trying to execute a DOS command.
>Windows Server 2008
>Commands I want to enter:
>schtasks /query /FO CSV /V >tasks.csv
>(This should create a .csv file with all the scheduled tasks in it).
>This works if I do it manually.
>What I've tried:
>options noxwait xsync;
>x 'cd c:\windows\system32\';
>x "schtasks /query /FO CSV /V >tasks.csv";
>It's not working.
>Any help would be greatly appreciated.