#9049 - 2001-05-30 09:15 PM
shell fails on win95 boxes
|
Anonymous
Anonymous
Unregistered
|
I've had great success on win2000 desktops just calling executable with kx32.dll in same folder.I'm trying to update some legacy windows 95 desktops. kix script uses message box and then a few shell lines.. Message box comes up no problem.. Next lines use shell statement to execute erase command and to execute an install for an app. These shell's work fine on win2000 desktops. Win 95 script execution doesn't show errors It doesn't stall, it only executes message box and drops out.. I've copied the kx*.dll's (kx95, kx16 & kx32 down into windows and windows\system
|
|
Top
|
|
|
|
#9051 - 2001-05-31 06:59 PM
Re: shell fails on win95 boxes
|
Anonymous
Anonymous
Unregistered
|
SetConsole("HIDE") If Exist("c:\windows\profiles\%net_name%\desktop\Page Gate.lnk") Shell "command /c echo @date,@time,@userid,@wksta,@ipaddress0,@address,PageGate 3.6 client setup not required >> \\amlars201\common\logs\pagegate\pgpoly.txt" $user=@USERID $name=@FULLNAME $ipa=@IPADDRESS0 $msg=$name + Chr(10) + "The PageGate Client shortcut icon is on your desktop" + Chr(10) + "If PageGate is not functioning properly" + Chr(10) + "Contact Joe Smith, (***) ***-****" MessageBox($msg, "PageGate Icon Update not Required", 64, 10) Else $user=@USERID $name=@FULLNAME $ipa=@ipaddress0 $msg=$name + Chr(10) + "The PageGate Client setup will now execute " + Chr(10) + "After installation completes, please run PageGate to verify connectivity" + Chr(10) + "If you need assistance" + Chr(10) + "Contact Joe Smith, (***) ***-****" MessageBox($msg, "PageGate Icon Update", 64, 10) ;run "erase note pa*.* /s"' ;run "\\amlars406\apps\pagegate\client\setup\pgcsetup.exe /S" ;shell 'regedit /s n:\pagegate\pagegate.reg"' shell 'command.com /c "echo @date,@time,@userid,@wksta,@ipaddress0,@address,PageGate 3.6 client setup executed >> c:\pgpoly.txt"' endif *************** I understand if my convenient variable values are now gone and I need to know how I can relate to the set variables in 95... I switched to run and app will install how can I use echo to txt file .. tried shell with the following... command.com /c %comspec% /c [This message has been edited by pearsdb (edited 31 May 2001).]
|
|
Top
|
|
|
|
#9052 - 2001-06-01 01:01 PM
Re: shell fails on win95 boxes
|
Alex.H
Seasoned Scripter
Registered: 2001-04-10
Posts: 406
Loc: France
|
You'll have to use this :
code:
Select case @INWIN=1 ; 1 for NTx , 2 for 9x/ME $UserName=@WUSERID case @INWIN=2 $UserName=@USERID endselect
$username will have the %net_name% value you use (as far it seems to me that it's the logon user name) Instead of this : c:\windows\profiles\%net_name%\desktop\Page Gate.lnk i suggest this : "%windir%\profiles\"+ $username +"\desktop\Page Gate.lnk" (%windir% will work on all Windows)For Echo : I use this and it work well : SHELL "%comspec% /C ECHO " + $texttowrite +" >> c:\...\file.txt"
[This message has been edited by Popovk (edited 01 June 2001).]
_________________________
? getobject(Kixtart.org.Signature)
|
|
Top
|
|
|
|
#9053 - 2001-06-01 05:15 PM
Re: shell fails on win95 boxes
|
Anonymous
Anonymous
Unregistered
|
Thanks, I've used %windir% both in kix and dos batch previously. I'll try your suggestion on shell statement .. I've been trying pretty similar shell statements with no result so far on win95 boxes.
|
|
Top
|
|
|
|
#9054 - 2001-06-03 05:19 PM
Re: shell fails on win95 boxes
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,We look at your script and we have some advise.
- use %comspec% instead of command call
- use shell instead of run call when your script must
wait on completion of this command.
- IF (exist("filename") <> 0) is must clear then
the usage of IF exist("filename").
- %net_name% is for use an unknown environment variable. By profiles
in a Windows 95 environment it will be the @userid value for existing profile of that user - c:\windows\profiles\@userid\desktop, or it will be the general desktop c:\windows[desktop.
- use new string format of kixtart
$message=@date+" "+@time instead of $message="@date @time"
The script can be:
code:
IF SetConsole("HIDE") ENDIF IF (Exist("c:\windows\profiles\"+@userid+"\desktop\Page Gate.lnk") <> 1) ; -shortcut doesn't exist- $message=@date+" "+@time+" "+@userid+" "+@wksta+" "+@ipaddress0+" "+@address SHELL "%comspec% /c echo "+$message+" PageGate 3.6 client setup not required >>\\amlars201\common\logs\pagegate\pgpoly.txt" $user=@userid $name=@fullname $ipa=@ipaddress0 $msg=$name+Chr(10)+"The PageGate Client shortcut icon is on your desktop"+Chr(10)+"If PageGate is not functioning properly"+Chr(10)+"Contact Joe Smith, (***) ***-****" MessageBox($msg, "PageGate Icon Update not Required", 64, 10) ELSE $user=@userid $name=@fullname $ipa=@ipaddress0 $msg=$name+Chr(10)+"The PageGate Client setup will now execute "+Chr(10)+"After installation completes, please run PageGate to verify connectivity"+Chr(10)+"If you need assistance"+Chr(10)+"Contact Joe Smith, (***) ***-****" ; shell "erase note pa*.* /s" ; shell "\\amlars406\apps\pagegate\client\setup\pgcsetup.exe /S" ; shell "regedit /s n:\pagegate\pagegate.reg" MessageBox($msg, "PageGate Icon Update", 64, 10) SHELL "%comspec% /c echo "+$message+" PageGate 3.6 client setup executed >>c:\pgpoly.txt" ENDIF
Greetings.
------------------ Site map:
|
|
Top
|
|
|
|
#9055 - 2001-06-05 01:42 AM
Re: shell fails on win95 boxes
|
Anonymous
Anonymous
Unregistered
|
I really appreciate your time helping me with this script... It now is working.. However.. kx32 hangs at end when system needs to restart once app has completed install.. I've tried run and shell for the app install and put quit and exit at the end of the script.. Thanks for all the great suggestions!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 492 anonymous users online.
|
|
|