#165994 - 2006-08-16 07:20 PM
Please help the dope
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
I profess I am a dope.. I am having the hardest time write to a file in a folder that has spaces.. What is the syntax.. I am missing something here.. Also should I use the function writeline or comspec echo as I have been using.. I am trying to write to C:\Documents and Settings\thom.dombrowski and can not.. I can write elsewhere. Thanks in advance from all the other dopes out here.
_________________________
You'll never know, unless you ask.
|
Top
|
|
|
|
#165996 - 2006-08-16 07:30 PM
Re: Please help the dope
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Here is it.. It will write to $server and not $local
$serialstring="$SerialNumb2,@userid,@wksta,$ipaddress,$recordate" $server="@lserver\netlogon\SerialNumbers\$lserver.txt" $local="C:\Documents and Settings\thom.dombrowski\serialnum.txt" shell '%comspec% /c ECHO '+$serialstring+' >> $server' shell '%comspec% /c ECHO '+$serialstring+' >> $local'
|
Top
|
|
|
|
#165997 - 2006-08-16 08:00 PM
Re: Please help the dope
|
eriqjaffe
Hey THIS is FUN
Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
|
Code:
shell "%comspec% /c ECHO " + $serialstring + " >> " + $server shell "%comspec% /c ECHO " + $serialstring + " >> " + chr(34) + $local + chr(34)
That should do it.
Edited by eriqjaffe (2006-08-16 08:03 PM)
|
Top
|
|
|
|
#165998 - 2006-08-16 08:06 PM
Re: Please help the dope
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Sorry that id nothing.. what was it, to begin with.. The problem lies in $local
|
Top
|
|
|
|
#165999 - 2006-08-16 08:10 PM
Re: Please help the dope
|
Mart
KiX Supporter
Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
|
Asuming that all variables get filled in a part of the script that comes before this part this should do the trick.
Code:
Break on ; $serialstring = $SerialNumb2+","+@userid+","+@wksta+","+$ipaddress+","+$recordate ; $local = %userprofile% $server = @LSERVER + "\netlogon\SerialNumbers\" + $lserver + ".txt" ; $rc = Open (1, $local + "\serialnum.txt", 5) $rc = Open (2, $server + $lserver ".txt", 5) $rc = WriteLine (1, $serialstring + @CRLF) $rc = WriteLine (2, $serialstring + @CRLF) $rc = Close (1) $rc = Close (2)
_________________________
Mart
- Chuck Norris once sold ebay to ebay on ebay.
|
Top
|
|
|
|
#166000 - 2006-08-16 08:11 PM
Re: Please help the dope
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Sorry my bad that does work, but what is the extra stuff??
|
Top
|
|
|
|
#166001 - 2006-08-16 08:19 PM
Re: Please help the dope
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Ah Ha %userprofile% that will help greatly.. thanks, and I will try the writeline.. Forums are the balls...
|
Top
|
|
|
|
#166003 - 2006-08-16 08:38 PM
Re: Please help the dope
|
Thom
Fresh Scripter
Registered: 2005-11-30
Posts: 39
|
Mark
Thanks for the help, was confussed by the char(34) 1st time I tried it, I had a problem.. But it is now resolved.. thanks.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 507 anonymous users online.
|
|
|