Avatar of mustafaosman
mustafaosman

asked on 

Creating a Script

Hi

I am trying to appened a logon script (vbs) to include this command to run on clients computers. Could anybody please help me as I have tried few things but still comes back with an error.

I tried something like this

Set Wshell = CreateObject("Wscript.shell")
Wshshell.run "%logonserver%\netlogon\lsclient.exe chelsea",0"",0"
But still gives me an expected end of statement

The command is

lsclient "servername" "Port"

Many Thanks
Microsoft Server OSMicrosoft Legacy OS

Avatar of undefined
Last Comment
mustafaosman
ASKER CERTIFIED SOLUTION
Avatar of markpalinux
markpalinux
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of DavusMaximus
DavusMaximus
Flag of United States of America image

You're defining wshell but referencing wshshell as well. If you have to have the quotes in the command line to lsclient, you want the window minimized when it runs and you want the script to wait until lsclient exits, it would look like this (replace port# with whatever port is appropriate):

 
 

Set Wshshell = CreateObject("Wscript.shell")
Wshshell.Run("%logonserver%\netlogon\lsclient.exe ""chelsea"" ""port#""", 0, True)

Open in new window

Avatar of mustafaosman
mustafaosman

ASKER

I have tried this
Set Wshell = CreateObject("Wscript.shell")
Wshshell.run "%logonserver%\netlogon\lsclient.exe chelsea",0

or this to wait for the application to finish:
Set Wshell = CreateObject("Wscript.shell")
Wshshell.run "%logonserver%\netlogon\lsclient.exe chelsea",0,true

none of them worked. OK did not return an error but still no result

The command is simple but I simply do not know how to write scripts

The command is as follows

lsclient.exe  "servername" "port"

Many thanks to your help
Avatar of mustafaosman
mustafaosman

ASKER

The script did not return any errors but it did not work.
Microsoft Server OS
Microsoft Server OS

The Microsoft Server topic includes all of the legacy versions of the operating system, including the Windows NT 3.1, NT 3.5, NT 4.0 and Windows 2000 and Windows Home Server versions.

59K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo