创建文件作为系统
我试图让系统(而不是用户)运行的程序写入文件,但我遇到了麻烦。以用户身份运行我的程序,文件会正确生成,但是使用 >PSExec -s myProgram.exe
运行相同的程序,不会生成任何文件。否则它似乎运行正确并且文件打开函数不返回 NULL;我需要做一些特殊的事情才能作为系统写入文件吗?
我在 Windows 7 64 位计算机和 Windows XP 32 上都遇到同样的问题。
I am trying to get a program run by System(rather than a user) to write to a file, but I am having trouble. Running my program as a user, the file is generated correctly, but running the same program using >PSExec -s myProgram.exe
, no file is generated. It seems to be otherwise running correctly and the file open function does not return NULL; is there something special I have to do to be able to write to a file as System?
I am having the same issue on both a Windows 7 64 bit machine and Windows XP 32.
参数:
要传递的参数(请注意,文件路径必须是目标系统上的绝对路径)
您是否使用文件的绝对路径?
另请检查您正在其中运行应用程序的文件夹权限。
arguments:
Arguments to pass (note that file paths must be absolute paths on the target system)
Are you using absolute path to the file?
Also check the folder permissions, you are running the application in.