• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Windows Script

Diaonic

Senior member
I'm hoping someone here could help me out with a script that I need to implement a new CRM system.

The script needs to be able to kill an active process IF it's running
I also need it to mount a network drive with user credentials. ( kinda like the net use \\server\share /user😀omain\username password )

Thanks
 
This is code for vbscript:

More examples can be found at http://msdn.microsoft.com/scripting/

'kill a process

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process WHERE Name = 'explorer.exe'")
For Each objProcess in colProcessList
objProcess.Terminate()
Next

'map a network drive
Set WshNetwork = WScript.CreateObject("WScript.Network")

WshNetwork.MapNetworkDrive "E:", "\\Server\Public", false, "username", "password"
 
Back
Top