Hi,
I used file.copy to copy a file to "C:\Windows\System32\drivers" but it did not work.if I changed the path as "D:\" or any others which is not a system folder The file.copy function can work.
File.Copy(SessionVar.Expand("%AppFolder%\\driver\\ net.sys"), SessionVar.Expand("%SystemFolder%\\drivers\\net.sy s"), true, true, true, true, nil);
and I changed method to copy the file.I used a bat file.if I ran the bat file directly.It worked,If I ran the bat file by setup factory it didn't work.
I think user permission causes this the problem .So I used the function
user_info =System.GetUserInfo() to check the permission. And user_info.IsAdmin==ture and user_info.IsVistaAdminLimitedToken==false.I think it means that the user is running with full privileges.
So I do know why the file.copy can not work?
I used file.copy to copy a file to "C:\Windows\System32\drivers" but it did not work.if I changed the path as "D:\" or any others which is not a system folder The file.copy function can work.
File.Copy(SessionVar.Expand("%AppFolder%\\driver\\ net.sys"), SessionVar.Expand("%SystemFolder%\\drivers\\net.sy s"), true, true, true, true, nil);
and I changed method to copy the file.I used a bat file.if I ran the bat file directly.It worked,If I ran the bat file by setup factory it didn't work.
I think user permission causes this the problem .So I used the function
user_info =System.GetUserInfo() to check the permission. And user_info.IsAdmin==ture and user_info.IsVistaAdminLimitedToken==false.I think it means that the user is running with full privileges.
So I do know why the file.copy can not work?
Comment