StumpedTechy
MIS
Okay I am running something remotely and the ONLY way I have been able to do this successfully is the following -
WshShell.Run "C:\psexec.exe \\" & strDeviceName & " -i C:\Delprof\Delprof.exe /q /i /d:10", 1, True
The problem is in psexec the delprof runs but requires a y response and an enter. (I am thinking it psexec not like the /q switch on delprof)
Is there any way to pipe a response to this prompt?
I ultimately want to delete all profiles older than 10 days from any remote computer this is ran against. ALso I am developing this because the few pages I have seen do not take into account all the variables.
E.G. this solution
does not take into account days in the cmdString = "delprof /p /c:\\" &strComputerName line though I fgured out a way to get days into it putting /d:10 before the /c: there are 2 problems I have to put delprof local on the PC I am running it from (I want it on a server) and the next line that says its completed won't wait until this is done (even when I tried to put a ,1 ,True at the end of the Run line.
Ultimately what I would like is this and eliminate psexec.exe altogether.
WshShell.Run "\\" & strServer & "\netadmin\Remote Profile Cleanup Script\Delprof\delprof /q /i /d:10 /c:\\" &strDeviceName,1 ,True
but that says I have not terminated the string eg no " before the first " but if I put in a ' this then yields more errors.
Hence why I went the psexec route in the first place.
Thoughts? Suggestions?
WshShell.Run "C:\psexec.exe \\" & strDeviceName & " -i C:\Delprof\Delprof.exe /q /i /d:10", 1, True
The problem is in psexec the delprof runs but requires a y response and an enter. (I am thinking it psexec not like the /q switch on delprof)
Is there any way to pipe a response to this prompt?
I ultimately want to delete all profiles older than 10 days from any remote computer this is ran against. ALso I am developing this because the few pages I have seen do not take into account all the variables.
E.G. this solution
does not take into account days in the cmdString = "delprof /p /c:\\" &strComputerName line though I fgured out a way to get days into it putting /d:10 before the /c: there are 2 problems I have to put delprof local on the PC I am running it from (I want it on a server) and the next line that says its completed won't wait until this is done (even when I tried to put a ,1 ,True at the end of the Run line.
Ultimately what I would like is this and eliminate psexec.exe altogether.
WshShell.Run "\\" & strServer & "\netadmin\Remote Profile Cleanup Script\Delprof\delprof /q /i /d:10 /c:\\" &strDeviceName,1 ,True
but that says I have not terminated the string eg no " before the first " but if I put in a ' this then yields more errors.
Hence why I went the psexec route in the first place.
Thoughts? Suggestions?