CMD EXPERIMENTS - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Microsoft Windows and Software
Click Here to Login
Reply
 
Thread Tools Display Modes
 
Old 03-16-2017, 08:46 AM   #1 (permalink)
Newb Techie
 
Join Date: Mar 2017
Location: USA
Posts: 14
Default CMD EXPERIMENTS

Hello all so I started to experiment with good old CMD and I know how to kill process on a remote computer but I can't find how to restart it back ?
For example when I kill explorer.exe all the desktop goes blank but when I try typing run explorer.exe or start explorer.exe it does not restart the whole desktop view. I'am using PSEXEC for remote connection so If you have any ideas how can I acctually restart any processes remotly ?
__________________

sporpigal is offline   Reply With Quote
Old 03-16-2017, 09:02 AM   #2 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,351
Send a message via MSN to S0ULphIRE
Default Re: CMD EXPERIMENTS

Quote:
From PowerShell, run a VBscript on a remote workstation and pass some parameters:

PS C:> $script='C:\Program Files\doanything.vbs'
PS C:> $args = "You can even provide arguments!"
PS C:> psexec -s \\workstation64 c:\windows\system32\cscript.exe $script $args
https://ss64.com/nt/psexec.html

Then in the script do whatever you want
__________________

__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 03-16-2017, 09:10 AM   #3 (permalink)
Dazed and confused
 
rulezero's Avatar
 
Join Date: Jan 2015
Location: Earth
Posts: 1,662
Default Re: CMD EXPERIMENTS

taskkill /f task
start task

thats all you need, what does it say when it errors?

taskkill /f explorer.exe
start explorer.exe

edit - just saw you said you use psexec.

instead just type "taskkill /S <computer> /u <username> /IM <imagename>

taskkill /s server1 /u mr.username /IM explorer.exe

you dont really need psexec as most remote fucntions are built into CMD, however psexec is good to mess with people
__________________
Don't like what I say, ban me!
rulezero is offline   Reply With Quote
Old 03-17-2017, 08:35 AM   #4 (permalink)
Newb Techie
 
Join Date: Mar 2017
Location: USA
Posts: 14
Default Re: CMD EXPERIMENTS

So tried the taskkill with f switch and off course it works but then I tried start explorer.exe so it did start the process but it didn't restart the windows screen. Any other ideas how to restart the damn thing , mabey opening browser directly with specific site ?
sporpigal is offline   Reply With Quote
Old 03-17-2017, 05:45 PM   #5 (permalink)
Dazed and confused
 
rulezero's Avatar
 
Join Date: Jan 2015
Location: Earth
Posts: 1,662
Default Re: CMD EXPERIMENTS

strange... It is correct and shouldnt be any issues...

maybe take screenshots or a short video of what your doing, like I said, what error are you getting or does it execute ok but nothing happens?

what happens if you stop / start explorer.exe via task manager?
__________________
Don't like what I say, ban me!
rulezero is offline   Reply With Quote
Old 03-17-2017, 07:54 PM   #6 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,351
Send a message via MSN to S0ULphIRE
Default Re: CMD EXPERIMENTS

Explorer runs on a per-user basis, maybe try specifying a username/password for the logged in user account for your psexec connection with the -u and -p flags
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 03-20-2017, 07:27 AM   #7 (permalink)
Newb Techie
 
Join Date: Mar 2017
Location: USA
Posts: 14
Default Re: CMD EXPERIMENTS

Probably it's the username and password thing. I have another issue but this one is far more complex. I'am trying to set up static ip adresses on all computers in my network and I'am thinking about remote options. Mabey a script to set all computers in the network or a object in gpo ?
sporpigal is offline   Reply With Quote
Old 03-20-2017, 08:12 AM   #8 (permalink)
The strange one
 
iParanormalx's Avatar
 
Join Date: Aug 2014
Location: US
Posts: 993
Default Re: CMD EXPERIMENTS

Why do you want all of them to be static? "Automatic static" sounds more like DHCP with huge a lease time.
__________________

iParanormalx is offline   Reply With Quote
Old 03-20-2017, 07:43 PM   #9 (permalink)
Lord Techie
 
S0ULphIRE's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 8,351
Send a message via MSN to S0ULphIRE
Default Re: CMD EXPERIMENTS

Quote:
Originally Posted by sporpigal View Post
Probably it's the username and password thing. I have another issue but this one is far more complex. I'am trying to set up static ip adresses on all computers in my network and I'am thinking about remote options. Mabey a script to set all computers in the network or a object in gpo ?
DHCP reservations = "automatic static IPs"
And that part you certainly can script. You can get the mac address of a PC with powershell, and you can use netsh in powershell to add a dhcp reservation.
Scripting out DHCP reservations in Windows Server 2008 with Netsh - TechRepublic
https://blogs.technet.microsoft.com/...d-mac-address/
__________________
"As a result of all this hardship, dirt, thirst, and wombats, you would expect Australians to be a sour lot. Instead, they are genial, jolly, cheerful, and always willing to share a kind word with a stranger, unless they are an American." -- Douglas Adams
S0ULphIRE is offline   Reply With Quote
Old 03-28-2017, 01:55 AM   #10 (permalink)
Newb Techie
 
Join Date: Mar 2017
Location: USA
Posts: 14
Default Re: CMD EXPERIMENTS

Thanks for all the suggestions regarding cmd
__________________

sporpigal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Experiments with internal pc parts without a mobo? fallenapples Monitors, Printers and Peripherals 8 12-18-2009 01:02 AM
The Extreme Diet Coke & Mentos Experiments Rundat Off Topic Discussion 15 06-05-2006 10:43 AM
Cooling experiments 180Mhz Overclocking and Modding 1 11-27-2005 02:46 PM
Cmd.exe FTP get cmd, transfers remote file to what local dir? Ropponmatsu Computer Networking and Internet Hardware 5 01-01-2004 12:47 PM
SU command in ms cmd prompt babaton Microsoft Windows and Software 4 08-28-2003 07:36 AM


Our Communities

Our communities encompass many different hobbies and interests, but each one is built on friendly, intelligent membership.

» More about our Communities

Automotive Communities

Our Automotive communities encompass many different makes and models. From U.S. domestics to European Saloons.

» More about our Automotive Communities

Marine Communities

Our Marine websites focus on Cruising and Sailing Vessels, including forums and the largest cruising Wiki project on the web today.

» More about our Marine Communities


Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 10:10 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.