#21430 - 2002-05-09 10:15 AM
runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
Hi All, Am pulling my hair out on this one. Am trying to run an .exe on a remote server as part of the log on script.
have trying using run & shell in various ways to the exe, then tried to run a local .bat but get the internal/extenal command error.
any suggests appriciated
|
|
Top
|
|
|
|
#21431 - 2002-05-09 01:12 PM
Re: runnig a .exe on remote server
|
Mark Bennett
Getting the hang of it
Registered: 2001-10-10
Posts: 70
|
Assuming these are NT servers you can use a reskit tool that is similar to Netware rconsole. What are you trying to do though?
|
|
Top
|
|
|
|
#21432 - 2002-05-09 01:52 PM
Re: runnig a .exe on remote server
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Colin,
Welcome to the board!
Can you show the bit of code that is giving you troubles? There maybe switches, etc. that are needed?
For example, here is how we are checking for WMI being installed on a system:
code:
;INSTALL WINDOWS MANAGEMENT INSTRUMENTATION :wmi ;CHECK TO SEE IF THE FOLDER EXISTS $wbempath="%WINDIR%\SYSTEM32\WBEM\." ;CHECK TO SEE IF THE FOLDER EXISTS IF 1 <> Exist("$WBEMPATH") RUN @ldrive+"Programs\wmint4.exe /s" RETURN ELSE RETURN ENDIF
HTH,
- Kent
|
|
Top
|
|
|
|
#21433 - 2002-05-09 03:39 PM
Re: runnig a .exe on remote server
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
It sounds like a permissions problem. Get it to work this way:
1. Share the proper location. -- \\server\share\filetorun.exe
2. Set permissions on the share folder (doublecheck to see if you can execute file outside logon script from remote PC under proper userid as well) to allow executable access for whoever is running the logon script (domain\everyone?)
3. execute from the logon script with:
SHELL "\\server\share\filetorun.exe" or SHELL "%comspec% /c \\server\share\filetorun.exe > nul"
Brian
|
|
Top
|
|
|
|
#21436 - 2002-05-10 02:42 PM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
I clarify, run the .exe in tokyo from the remote server in singapore
tried RUN '\\server\share\.exe' but it falls over. probably due to the WAN delay.
did get the script ot run a local .bat, finally, which executes the remote .exe. I'd rather just run the .exe
|
|
Top
|
|
|
|
#21437 - 2002-05-10 03:36 PM
Re: runnig a .exe on remote server
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Hmm... well if a delay is causing the problem, then you might want to look into copying the file locally (perhaps to your %temp% folder -- assuming it exists), and executing it from there.
Brian
|
|
Top
|
|
|
|
#21438 - 2002-05-14 05:42 AM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
Brian, can't copy to the local machine as the .exe requires other files on the share to log info of the client.
My next question is does anyone have any code i can use to, long winded. check for a file in the root dir, if not there create and write the date, then do a run. if the file exists, read the date and if over 90 days do a run otherwise skip.
Thanks
Colin
|
|
Top
|
|
|
|
#21439 - 2002-05-14 06:05 AM
Re: runnig a .exe on remote server
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
Break your requested functionality down into individual steps and starting reading the manual.
1. if Exist() 2. Create what? See Open, Writeline, WriteProfileString, etc. 3. See RUN and SHELL. You may want to start your program from a batch so that you can change to the remote drive and and directory. It may help in the execution of the file. 4. ELSE to #1 5. endif Somewhere in there you want a GetFileTime() [ 14 May 2002, 06:07: Message edited by: Howard Bullock ]
|
|
Top
|
|
|
|
#21441 - 2002-05-15 09:29 AM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
just found out, half my problem was the version of KIX32 i was trying to run, now have the latest and I can use the open command.
Still plugging along, let you know how it ends up
|
|
Top
|
|
|
|
#21442 - 2002-05-15 10:52 AM
Re: runnig a .exe on remote server
|
Mark Bennett
Getting the hang of it
Registered: 2001-10-10
Posts: 70
|
What is the EXE you are trying to run? Another option may be to schedule to EXE from your script on the server (at say 1 minute in the future).
Mark
|
|
Top
|
|
|
|
#21443 - 2002-05-16 02:50 PM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
Les,
Arrrh, tried using the Datemath function but am getting a Script error: expected expression ! Am just testing how it work with the examlpe, $LastWeek=DateMath(@Date,-7)
What am i doing wrong. the functions are at the end of my sript file.
Colin
|
|
Top
|
|
|
|
#21445 - 2002-05-16 02:57 PM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
Yep, 4.02, and I have both DateMath and SerialDate functions
|
|
Top
|
|
|
|
#21447 - 2002-05-16 03:19 PM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
Les,
Codes a bit ruff at the moment but if I run the function by itself it works, in the script it fauls
if exist ("%systemdrive%\emran.txt") ?"It's there..." $file = "%systemdrive%\emran.txt" IF Open(1, $file) = 0 $x = ReadLine(1) ;WHILE @ERROR = 0 ? "Line read: [" + $x + "]" ;$x = ReadLine(1) ? "Currentdate: [" + @DATE + "]" ;LOOP Close (1) ELSE BEEP ? "Config file not opened, error code: [" + @ERROR + "]" ENDIF ?"prefunction" $DaysBetween=DateMath(@DATE,-7) ? "DaysBetween=" +$DaysBetween
;if over 90 days run ;endif else
|
|
Top
|
|
|
|
#21449 - 2002-05-16 03:41 PM
Re: runnig a .exe on remote server
|
Colin Williamson
Fresh Scripter
Registered: 2002-05-09
Posts: 19
Loc: Sydney
|
Les,
the last else is for extra code that works and the UDF's are at the bottom
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 293 anonymous users online.
|
|
|