Jump to content


  • 0
oyvindskj

Using cmd files in a sccm 2012 application

Question

I'm i bit puzzeld at the moment. I've tryed to create an Application to install an msi program and then copy a linces file to a lokal path on the computer. The MSI part of tings work great but not the script I'm running to copy the lisence file. I'm using a simple cmd script to copy the fil and im ending up With a error 0x1(acces denied). I'f I create an package the script Works. Is it not possible to use cmd scripts within an Application? Cheers, Øyvind Skjellin

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

Maybe you forgot to switch the app to run as local system. Custom apps are running in the user context per default.

Anyways, create an MST file for your MSI which copies the lic file to the correct location. This way you need only a single app.

Share this post


Link to post
Share on other sites

  • 0

Maybe you forgot to switch the app to run as local system. Custom apps are running in the user context per default.

Anyways, create an MST file for your MSI which copies the lic file to the correct location. This way you need only a single app.

Thanks but an Application doesn't have that option to "run as administrator". Creating a .exe/msi file would fix it but I was hoping to just run a cmd script/xcopy string directly from the Application/deployment.

Share this post


Link to post
Share on other sites

  • 0

Try doing VBScripts for the installation and uninstallation, they should work.

 

I've done couple of these, for example for VLC Mediaplayer.

I'm not going to install using VBS. The SCCM Application will do the thing for the msi installation. Is the copy of the lic file I need to get working within an Application.

Share this post


Link to post
Share on other sites

  • 0

Which OS are you installing with - Win 7, 64-bit? If so, be aware that you cannot copy directly to the c:\ drive. Also be cautious of the syswow64 and system32 folders as well as the Wow6432Node registry key. For instance, a 32-bit command prompt will not be able to copy to the Win 7 system32 folder properly. <editorial>Why MS decided to keep the 'System32' folder for 64-bit, is so confusing....</editorial>

Share this post


Link to post
Share on other sites

  • 0

I'm not going to install using VBS. The SCCM Application will do the thing for the msi installation. Is the copy of the lic file I need to get working within an Application.

 

And that's what the vbscript could accomplish for you.. just wrap the msi installation in to the vbscript and add the copying of files to the same script. Use detection method by combining the msi's product code and existence of the .lic file.. pretty simple.

 

My idea is that you WRAP the whole installation in to a single script that does the exact thing you're aiming for.

Share this post


Link to post
Share on other sites

  • 0

And that's what the vbscript could accomplish for you.. just wrap the msi installation in to the vbscript and add the copying of files to the same script. Use detection method by combining the msi's product code and existence of the .lic file.. pretty simple.

 

My idea is that you WRAP the whole installation in to a single script that does the exact thing you're aiming for.

I see your point and it's one way of doing it. I'm was hoping to just kick of a xcopy command within an application just as I do with packages.

Share this post


Link to post
Share on other sites

  • 0

Which OS are you installing with - Win 7, 64-bit? If so, be aware that you cannot copy directly to the c:\ drive due. Also be cautious of the syswow64 and system32 folders as well as the Wow6432Node registry key. For instance, a 32-bit command prompt will not be able to copy to the Win 7 system32 folder properly. <editorial>Why MS decided to keep the 'System32' folder for 64-bit, is so confusing....</editorial>

I'm copying to a folder in %programdata%.

Share this post


Link to post
Share on other sites

  • 0

%ProgramData% you should be able to copy to. Your ConfigMgr package needs to run with administrative rights (run as SYSTEM) to access the ProgramData folder.

 

If your package consists of License.lic and Install_License.cmd, your script could look like this:

 

SET yourpath=%~dp0

XCOPY "%yourpath%License.lic" "%ProgramData%\Microsoft\Windows\blah\blahblah"

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.