|
-
Feb 20th, 2012, 09:42 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Output batch file to text file both are in user temp folder
this works fine in XP bu not with vista and 7 due to permission issues, i think
Code:
Shell "C:\Windows\Temp\myinfo.bat C:\Windows\Temp\outfile.txt", vbHide
so i was thinking about doing something like below but im getting a file not found and the file is there. so i guess the code is wrong but cant get it right
Code:
Shell Environ("temp") & "\myinfo.bat" > Environ("temp") & "\outfile.txt"
when i do
Code:
MsgBox Environ("temp")
the path has spaces and i get "C:\docume~1\" so my code needs to add quotes but cant get the code right. any help?
-
Feb 21st, 2012, 12:46 AM
#2
Re: Output batch file to text file both are in user temp folder
I would be surprised if the UAC lets you write anything to the Windows tree
-
Feb 21st, 2012, 03:06 AM
#3
Frenzied Member
Re: Output batch file to text file both are in user temp folder
this works fine in XP bu not with vista and 7 due to permission issues, i think
if it is having permission issue then USER Account Settings Will solve this issue obviously. just minimize the Slider of UAC Down .and then
try to run the project .hope this might be useful .
-
Feb 21st, 2012, 06:10 AM
#4
Re: Output batch file to text file both are in user temp folder
try like
vb Code:
shell """" & environ("temp") & "\myinfo.bat"""
same for other path
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|