Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Blank lines with comspec (cmd)?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,61776
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Blank lines with comspec (cmd)?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Blank lines with comspec (cmd)? - 6/24/2008 1:22:30 AM   
  asgaroth

 

Posts: 12
Score: 0
Joined: 5/14/2008
Status: offline
Hello,
i wanted to add blank lines to a log file.
The logfile is created by " wshShell.run "CMD /C echo sometext >> " & logfile"
I tried "wshShell.run "CMD /C echo " & vbNewline & " >> " & logfile" and such things but nothing seems to work.

I dont have the oppertunity to open up the file with OpenTextFile... because of some permission issues i have.

Thanks in advance, asgaroth
 
 
Post #: 1
 
 RE: Blank lines with comspec (cmd)? - 6/24/2008 1:49:45 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
I have to be honest with you. I think you either need to sort out your permission issue or echo something other than a blank line.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to asgaroth)
 
 
Post #: 2
 
 RE: Blank lines with comspec (cmd)? - 6/24/2008 8:28:15 PM   
  asgaroth

 

Posts: 12
Score: 0
Joined: 5/14/2008
Status: offline
Thanks for your honest reply...
I already thought that this would be a problem.

I will try with some other character, maybe | or something, because i don't think i can resolve that permission issue.
This is because i work for a university with logfiles which are already filled and i have to preserve them.
These logfiles only have write but no read permissions.
And i think i can't change >100 file permissions only to get that working with "OpenTextFile".
With that "wshShell.run "CMD /C echo sometext >> " & logfile" it works without reading rights, maybe because the output is
produced by the system and the system has overlaying rights.

Thanks again, asgaroth

(in reply to ebgreen)
 
 
Post #: 3
 
 RE: Blank lines with comspec (cmd)? - 6/24/2008 10:21:52 PM   
  DiGiTAL.SkReAM


Posts: 1170
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
try this:
wshShell.Run "%comspec% /c echo. >> logfile",0,true


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to asgaroth)
 
 
Post #: 4
 
 RE: Blank lines with comspec (cmd)? - 6/25/2008 12:17:16 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Yay digital!

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 5
 
 RE: Blank lines with comspec (cmd)? - 6/29/2008 8:29:38 PM   
  asgaroth

 

Posts: 12
Score: 0
Joined: 5/14/2008
Status: offline
Thanks!

That really works!

Now everything is fine with the output.

Best Regards, asgaroth

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Blank lines with comspec (cmd)? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts