Jump to content

@ComSpec Eror Syntax


Krikov
 Share

Recommended Posts

Hello

i have a script that when i press the button it take two Var and try to Kill a running process

on a remote computer with pskill.exe

this is the line

$CompName = "\\MyPC"
$ListItem = "Notepad.exe"
RunWait(@ComSpec & '/c c:\temp\pskill.exe -t '& $CompName & ' -u username -p password ' & $ListItem)

This is Run Error

RunWait(@ComSpec & '/c c:\temp\pskill.exe -t ' & $CompName & ' -u username -p password' & $ListItem)

The system cannot find the path specified.

:lmao:

Krikov

[topic="63488"][font="Arial"]Krikov Tray Quick Menu[/font][/topic]

Link to comment
Share on other sites

$CompName = "\\MyPC"
$ListItem = "Notepad.exe"
RunWait(@ComSpec & '/c c:\temp\pskill.exe -t '& $CompName & ' -u username -p password ' & $ListItem)
I'm not completely familiar, but try this:

$CompName = "\\MyPC"
$ListItem = "Notepad.exe"
RunWait(@ComSpec & '/c Start c:\temp\pskill.exe -t '& $CompName & ' -u username -p password ' & $ListItem)

[u]My UDFs[/u]Coroutine Multithreading UDF LibraryStringRegExp GuideRandom EncryptorArrayToDisplayString"The Brain, expecting disaster, fails to find the obvious solution." -- neogia

Link to comment
Share on other sites

you shouldnt bump your post like that

try:

RunWait('C:\temp\pskill.exe -t ' & $CompName & ' -u username -p password ' & $ListItem)

The bug in your old code was the missing space before '/c' if you cared.

But running it directly is better.

Edited by w0uter

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...