Click here to Skip to main content
15,896,471 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: German... Pin
Clodetta del Mar8-Dec-13 11:40
Clodetta del Mar8-Dec-13 11:40 
GeneralRe: German... Pin
Clodetta del Mar8-Dec-13 12:39
Clodetta del Mar8-Dec-13 12:39 
GeneralRe: German... Pin
Member 41945938-Dec-13 13:46
Member 41945938-Dec-13 13:46 
GeneralRe: German... Pin
Clodetta del Mar9-Dec-13 2:41
Clodetta del Mar9-Dec-13 2:41 
GeneralRe: German... Pin
Richard Deeming9-Dec-13 1:42
mveRichard Deeming9-Dec-13 1:42 
GeneralRe: German... Pin
Clodetta del Mar9-Dec-13 2:45
Clodetta del Mar9-Dec-13 2:45 
GeneralRe: German... Pin
Member 41945938-Dec-13 14:03
Member 41945938-Dec-13 14:03 
GeneralSCHTASKS.EXE and Windows, and PSEXEC Pin
#realJSOP6-Dec-13 2:27
professional#realJSOP6-Dec-13 2:27 
I just spent three weeks trying to figure out the nuances of restarting a process on a remote Windows machine from a web site. The task description started out as "convert an existing VBS script to c# so we could use it from a web site".

Windows XP Embedded does ship with schtasks.exe. This means you can't schedule tasks on the box, so you have to run PSEXEC instead to run your process directly. The PSExec thing on XP boxes is a relative piece of cake to get working. The problems exist in schtasks.

Non-embedded versions of Windows have schtasks, and you have to run it with WMI to avoid permissions entanglements. You also have to be very careful of how you specify parameters. Windows XP uses schtasks v5, and Windows 7 uses v6. If you specify a command line parameter that doesn't exist for the given version of schtasks you're trying to run, it simply doesn't do anything (and v6 has params that v5 doesn't have). Since you're running via WMI, you can't capture stderr or stdout, either.

This has been a freaking nightmare. We still haven't figured out why it won't work in a virtual machine, but for me that's a non issue since the web site won't be manipulating VMs at all.

BTW, you know you have problems when you run schtasks and you don't get a file in the (Win7) Windows/System32/Tasks folder, or the (XP) Windows/Tasks folder. It's important that you have an account on the remote box in question so you can observe (via remote desktop) the task manager and the Tasks folder. Without that ability, you have no hope of determining exactly what has occurred.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013



modified 6-Dec-13 9:26am.

GeneralRe: SCHTASKS.EXE and Windows, and PSEXEC Pin
Marc Clifton6-Dec-13 2:39
mvaMarc Clifton6-Dec-13 2:39 
GeneralRe: SCHTASKS.EXE and Windows, and PSEXEC Pin
Nagy Vilmos6-Dec-13 2:41
professionalNagy Vilmos6-Dec-13 2:41 
GeneralSnow Pin
Corporal Agarn6-Dec-13 2:22
professionalCorporal Agarn6-Dec-13 2:22 
GeneralRe: Snow Pin
S Houghtelin6-Dec-13 2:47
professionalS Houghtelin6-Dec-13 2:47 
GeneralRe: Snow Pin
Corporal Agarn6-Dec-13 6:39
professionalCorporal Agarn6-Dec-13 6:39 
GeneralRe: Snow Pin
S Douglas6-Dec-13 8:17
professionalS Douglas6-Dec-13 8:17 
GeneralRe: Snow Pin
GuyThiebaut6-Dec-13 3:18
professionalGuyThiebaut6-Dec-13 3:18 
GeneralRe: Snow Pin
Deflinek6-Dec-13 3:50
Deflinek6-Dec-13 3:50 
GeneralRe: Snow Pin
GuyThiebaut6-Dec-13 4:01
professionalGuyThiebaut6-Dec-13 4:01 
GeneralXOTD Pin
Nagy Vilmos6-Dec-13 2:18
professionalNagy Vilmos6-Dec-13 2:18 
GeneralRe: XOTD Pin
Marc Clifton6-Dec-13 2:33
mvaMarc Clifton6-Dec-13 2:33 
GeneralRe: XOTD Pin
Richard Deeming6-Dec-13 2:34
mveRichard Deeming6-Dec-13 2:34 
GeneralRe: XOTD Pin
Jörgen Andersson6-Dec-13 3:03
professionalJörgen Andersson6-Dec-13 3:03 
GeneralRe: XOTD Pin
Roger Wright6-Dec-13 4:22
professionalRoger Wright6-Dec-13 4:22 
GeneralRe: XOTD Pin
Jörgen Andersson6-Dec-13 9:26
professionalJörgen Andersson6-Dec-13 9:26 
GeneralRe: XOTD Pin
glennPattonWork36-Dec-13 5:21
professionalglennPattonWork36-Dec-13 5:21 
GeneralProject Management and scifi thought of the day Pin
Ernst Iliov Stavro Blofeld6-Dec-13 1:43
Ernst Iliov Stavro Blofeld6-Dec-13 1:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.