No announcements
Found 2234941 threads
-
4 Votes
%~dp0 in Powershell
$PSScriptRoot was introduced in PowerShell 3.0. In v2 you can try this: $ScriptRoot = Split-Path $MyInvocation.MyCommand.Path ...Answered | 7 Replies | 6892 Views | Created by DRHeinz - Wednesday, May 23, 2018 1:34 PM | Last reply by Leif-Arne Helland - Wednesday, May 23, 2018 9:08 PM -
0 Votes
get current directory
I am trying to mimic %~dp0 in powershell. I need to deploy a CM2012 package which is a .ps1 script and I need to then have it run more stuff. As you ...Proposed | 2 Replies | 368 Views | Created by mqh7 - Tuesday, January 10, 2017 10:26 PM | Last reply by jrv - Tuesday, January 10, 2017 11:16 PM -
3 Votes
Powershell equivalent of DOS %~dp0 command
If you're using PowerShell version 3.0 or later, this is in an automatic variable called $PSScriptRoot. In PowerShell 2.0, that variable didn't ...Answered | 3 Replies | 27645 Views | Created by NeedAnswers8 - Wednesday, February 26, 2014 8:30 PM | Last reply by Tony Chirillo - Friday, June 12, 2015 9:56 PM -
0 Votes
%dp0 - works for BDPs?
Quick additional note here, %~dp0 is a batch file varaible: thus using it outside of a batch file is meaningless.Jason | http://blog.configmgrftw.com | Twitter @JasonSandysAnswered | 3 Replies | 4160 Views | Created by IUSR345369 - Wednesday, February 22, 2012 7:54 AM | Last reply by Jason Sandys [MSFT] - Wednesday, February 22, 2012 3:13 PM -
1 Votes
continue to run the batch file after poweshell is called
hi team, we have one urgent requirement that, we wanted to exit from powershell mode after it ran from batch file and continue to run the remaining ...Unanswered | 2 Replies | 480 Views | Created by continue to run batch file after poweshell is call - Wednesday, August 29, 2018 12:41 PM | Last reply by continue to run batch file after poweshell is call - Thursday, August 30, 2018 8:33 AM -
0 Votes
%~DP0 and batch file
Lats, Does this work when executing the install manually from a command prompt in the same user context that you are executing the SoftDist deployment ...Answered | 5 Replies | 14990 Views | Created by Lats - Tuesday, June 15, 2010 2:00 PM | Last reply by Biometric Engineer - Tuesday, July 27, 2010 9:27 PM -
0 Votes
powershell Microsoft.SMS.TSEnvironment
No the "%~dp0" was in a batch file :) I was able to resolve the problem by using the "Run PowerShell ...Answered | 3 Replies | 5416 Views | Created by MK-Maddin - Thursday, November 5, 2015 10:34 AM | Last reply by Marc Collins - Monday, June 6, 2016 2:32 AM -
0 Votes
Running .cmd from SCCM 2007 ("%~dp0)
=0d93faf7-32c9-431c-ba49-71dc4c422a16&ItemID=18 Why should this answer his question? He is already using %~dp0 for copying files and they ...Answered | 8 Replies | 13990 Views | Created by KennyBrez - Wednesday, August 31, 2011 8:55 AM | Last reply by KennyBrez - Thursday, September 1, 2011 8:11 AM -
0 Votes
Powershell Script
I have the batch file listed below but, I need a PowerShell Scrript that installs an msiexec.msi package from the current directory and places it in the specified ...Answered | 3 Replies | 677 Views | Created by dmac46 - Sunday, July 24, 2016 1:57 PM | Last reply by Cartman Shen - Monday, July 25, 2016 5:51 AM -
0 Votes
MDT WinPE TSEnv variables and pathing some powershell scripts.
process, plus the powershell script. I was thinking maybe I could do some sort of set unc=%~dp0 or something and make a $env:unc or something, but I was hoping ...Answered | 3 Replies | 2117 Views | Created by MrBrooks - Friday, January 24, 2014 1:55 PM | Last reply by MrBrooks - Friday, January 31, 2014 2:09 PM -
0 Votes
What is the equivalent of "%~dp0" in vbs?
I'm trying to copy a directory directly from our source sccm server and it fails. How can I reference the directory on the local machine when this source is packaged up and temporarily sent to ...Answered | 1 Replies | 8547 Views | Created by Enten - Wednesday, May 4, 2011 2:46 PM | Last reply by TorstenM - Wednesday, May 4, 2011 3:05 PM -
1 Votes
MDT Powershell Application
my problem with running PowerShell scripts to install application with MDT. I needed this solution because the execution policy is set to restricted in our image. This also allows ...Answered | 5 Replies | 11915 Views | Created by Russel_ - Thursday, April 5, 2012 3:07 PM | Last reply by Russel_ - Friday, April 6, 2012 7:18 PM -
1 Votes
Need a powershell script for contentdb backup everyday in sharepoint 2010
powershell script present) and name it as MySPBackUpBatch.batcopy paste below content to the batch file and save. cd /d ...Answered | 2 Replies | 2980 Views | Created by ramesh.v2222 - Monday, September 24, 2012 9:47 AM | Last reply by Senthilrajan Kaliyaperumal - Monday, September 24, 2012 11:46 AM -
0 Votes
Current Directory Working Directory when using Run as Administrator
-noprofile -noexit cd %~dp0 or if you have predefined settings in shortcut,you may use:  Answered | 2 Replies | 10615 Views | Created by DFatUSM - Wednesday, April 6, 2011 4:51 PM | Last reply by Kazun - Wednesday, April 6, 2011 5:33 PM -
0 Votes
After setting unrestricted PowerShell 1.0, unsigned code still showing PSSecurityException
I have created a batch script that wraps a powershell script. sitecheck_plugin.bat and sitecheck_plugin.ps1 In sitecheck_plugin.bat my code is ...Answered | 2 Replies | 8660 Views | Created by NI_Core_Dev - Monday, October 17, 2011 8:00 AM | Last reply by Fernando Tubio - Tuesday, October 18, 2011 7:43 PM -
0 Votes
How to Pre-populate Folders within a newly Created Parent Folder.
Hi Ryan, We can use PowerShell with CSOM to achieve it. The following script for your reference: $0 = ...Answered | 1 Replies | 487 Views | Created by Cypher Net - Monday, November 14, 2016 2:57 PM | Last reply by Dennis Guo - Tuesday, November 15, 2016 8:42 AM -
1 Votes
Powershell Error in Powershell ISE
Hi, Please try this article http://office365support.ca/connecting-to-office365-with-powershell/ it worked fine with me in windows ...Unanswered | 3 Replies | 4816 Views | Created by SteveXT - Friday, December 6, 2013 8:09 PM | Last reply by Sameh Khairy - Tuesday, December 6, 2016 8:03 AM -
1 Votes
OSD and Powershell
hi, finally figured it out....created a .cmd file with powershell commands in this file .... created a package and in the program part gave the name of the file to be ...Answered | 6 Replies | 11623 Views | Created by Bas van der Kruijssen - Tuesday, March 2, 2010 7:33 AM | Last reply by Pranay Kumar (MCP,MCTS,MCITP) - Friday, June 24, 2011 12:29 PM -
0 Votes
ps1 script doesn't full run via Task Scheduler
" in a task. Task Scheduler to run powershell: Program: PowerShell Arguments: -Command "Start-Process –FilePath ...Unanswered | 1 Replies | 519 Views | Created by Johnny_HoMing - Monday, July 9, 2018 5:04 AM | Last reply by jrv - Monday, July 9, 2018 5:17 AM -
1 Votes
By Using Batch file copy commented array to powershell script in particular line
line is only a string. One workaround for this is to use a delimiter character that you can embed in the string that you use for the powershell.exe ...Answered | 5 Replies | 1246 Views | Created by Sri Krishna K U N - Friday, March 2, 2018 6:19 AM | Last reply by Bill_Stewart - Tuesday, March 6, 2018 3:59 PM - Items 1 to 20 of 2234941 Next ›
No announcements