cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
rbrand
Level 3

CreateDir in Server 2008

I am having issues with Windows Server 2008. Through installscript I am trying to crate an internet shortcut (which is pretty much just an ini file) to show up under start\All programs\FolderName\, but it won't let me create this FolderName using CreateDir. I have rights, b/c I am logged in as Administrator to this server (it's a test Server). I can manually create this folder through explorer so I have sufficient rights. Any ideas why I can't create a folder? The actual path to this directory I am using is: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\. My command in installscript is:

szPath2 = "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\Hello";
LongPathToQuote ( szPath2, TRUE );
Return = CreateDir(szPath2);

Help?!?
Labels (1)
0 Kudos

(4) Replies
RobertDickau
Flexera Alumni

Perhaps pass the return value through FormatMessage to see what the specific problem is?
0 Kudos
rbrand
Level 3

I have done this. The message only gave me a reason code of -1.
0 Kudos
RobertDickau
Flexera Alumni

I don't have a Windows Server 2008 system at hand, but does it work if you use FOLDER_PROGRAMS instead of the hard-coded path? This is a pure InstallScript project and not an MSI with an InstallScript custom action?
0 Kudos
rbrand
Level 3

I did try the FOLDER_PROGRAM and it gives me the same results. I verified and the path they use is the exact same as when I hard-code it.
0 Kudos