Page 1 of 1 1
Topic Options
#131695 - 2004-12-21 09:31 PM using variables..
hearmeout Offline
Fresh Scripter

Registered: 2002-03-26
Posts: 43
Hey guys,

I have written this script but I don't know what is wrong, i have tried a lot of method (" ", '""', etc) but it's not working can you point out what is wrong?

for $ip = 1 to 5
MessageBox ("test " + $ip, "test") ; this works
Shell 'Del /s \\10.20.32.$ip\c$\umxlu32.exe' ; this does work
; Shell 'del /s "\\10.20.32." + $ip + "\c$\umxlu32.exe"' ; this does work either.

Son ^_^
next

Top
#131696 - 2004-12-21 09:38 PM Re: using variables..
hearmeout Offline
Fresh Scripter

Registered: 2002-03-26
Posts: 43
please ignore son ^_^ that's not in the script.
Top
#131697 - 2004-12-21 09:39 PM Re: using variables..
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
$ip is a numerical value and not a string. Try assembling the entire SHELL command as a string first. I wrote a FAQ on the use of SHELL.

Why do you even need to SHELL out when KiX has a DEL command?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#131698 - 2004-12-21 10:01 PM Re: using variables..
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Untested:
Code:
Break On
for $ip = 1 to 5
$SHellCMD = 'Del /s \\10.20.32.'+$ip+'\c$$\umxlu32.exe'
'Shell command = '+$SHellCMD ?
Shell $SHellCMD
next

for $ip = 1 to 5
DEL '\\10.20.32.'+$ip+'\c$$\umxlu32.exe /S'
;DEL '\\10.20.32.'+$ip+'\c$$\umxlu32.exe' /S
next

_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#131699 - 2004-12-21 10:22 PM Re: using variables..
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Doesn't a SHELL to "Del" require '%comspec% /c'?

shell '%comspec% /c del c:\somefile.txt'
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#131700 - 2004-12-21 10:26 PM Re: using variables..
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Ja, well... if I read my own FAQ... I did say "Untested".
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#131701 - 2004-12-21 10:35 PM Re: using variables..
hearmeout Offline
Fresh Scripter

Registered: 2002-03-26
Posts: 43
oh, i'm use the shell to del because it has the option /s which deletes umxlu32 from subdirectories.

windows 2000 and xp

Top
#131702 - 2004-12-21 10:37 PM Re: using variables..
hearmeout Offline
Fresh Scripter

Registered: 2002-03-26
Posts: 43
oh, thanks, by the way. I've learnt something new today. strings.. (seriously) thanks guys and gals.
Top
#131703 - 2004-12-21 11:31 PM Re: using variables..
hearmeout Offline
Fresh Scripter

Registered: 2002-03-26
Posts: 43
guys, i'm wearing the dunce hat and sitting in the corner the del from kiXtart also has that functionality.
Top
#131704 - 2004-12-21 11:36 PM Re: using variables..
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Well... I was stewing over the "guys and gals" bit, but was going to let it and the KiX DEL command slide.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1607 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.066 seconds in which 0.037 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org